At wit's end with linker...help please!

Erik Christiansen erik@dd.nec.com.au
Wed Oct 31 07:35:00 GMT 2007


On Tue, Oct 30, 2007 at 07:02:02PM -0700, Rick Mann wrote:
> I have a file vectors.S that assembles to vector.o. My linker script  
> has a part:
> 
> 	. = ALIGN(4);
> 	.text :
> 	{
> 		obj/start.o(.text);
> 		src/Interrupts.o(.text);
> 		*(.text);
> 		
> 		. = ALIGN(4);
> 		gVectorsStart = .;
> 		KEEP (obj/vectors.o(.text));
> 		gVectorsEnd = .;
> 	}
[snip]
> 
> But the output map shows that gVectorsStart/End have the same value:

Isn't that because it's being linked in before gVectorsStart, by
"*(.text);" ?  ;-)

To check, you could run "arm-elf-objdump -d" on the linker output file.

Alternatively, if there's a global symbol in vectors.S, then generating
a map file from ld would show where that lobs up.

For an easier way to write the above, you might find mileage in "3.6.4.1
Input Section Basics" in "info ld". (EXCLUDE_FILE comes to mind.)

Erik



More information about the Binutils mailing list