> I read about this and added a KEEP() around the regarding input > sections, but it should not matter in this case, because for the > variant.S file it works.
Im not sure this is true. I guess the KEEP() will only help if the object file is loaded. If no symbols in the file are referenced, it never loads the file and so never knows it needs to keep anything. The real solution here is the reference one of your symbols which must be in the image, or move it into libextras.a, which the linker will never discard symbols from. Andrew