This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: At wit's end with linker...help please!
- From: erik at dd dot nec dot com dot au (Erik Christiansen)
- To: Rick Mann <rmann at latencyzero dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Wed, 31 Oct 2007 13:35:09 +1100
- Subject: Re: At wit's end with linker...help please!
- References: <1E29A504-FF20-4259-B40D-DF6DEC5B4A42@latencyzero.com>
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