public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* At wit's end with linker...help please!
@ 2007-10-31  2:23 Rick Mann
  2007-10-31  2:34 ` Daniel Jacobowitz
  2007-10-31  7:35 ` Erik Christiansen
  0 siblings, 2 replies; 5+ messages in thread
From: Rick Mann @ 2007-10-31  2:23 UTC (permalink / raw)
  To: binutils

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 = .;
	}


vectors.o is:

$ arm-elf-objdump -d obj/vectors.o

obj/vectors.o:     file format elf32-littlearm

Disassembly of section .text:

00000000 <vectors>:
    0:	e59ff018 	ldr	pc, [pc, #24]	; 20 <ResetHandlerAddr>
    4:	e1a00000 	nop			(mov r0,r0)
    8:	e1a00000 	nop			(mov r0,r0)
    c:	e1a00000 	nop			(mov r0,r0)
   10:	e1a00000 	nop			(mov r0,r0)
   14:	e1a00000 	nop			(mov r0,r0)
   18:	e1a00000 	nop			(mov r0,r0)
   1c:	e1a00000 	nop			(mov r0,r0)

00000020 <ResetHandlerAddr>:
   20:	00000000 	.word	0x00000000


But the output map shows that gVectorsStart/End have the same value:

                 0x80024a50                gVectorsStart = .
  obj/vectors.o(.text)
                 0x80024a50                gVectorsEnd = .


Implying that my vector table is not being linked in.

Can someone tell me what I'm doing wrong? Thank you!!!

-- 
Rick

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: At wit's end with linker...help please!
  2007-10-31  2:23 At wit's end with linker...help please! Rick Mann
@ 2007-10-31  2:34 ` Daniel Jacobowitz
  2007-10-31 19:03   ` Rick Mann
  2007-10-31  7:35 ` Erik Christiansen
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2007-10-31  2:34 UTC (permalink / raw)
  To: Rick Mann; +Cc: binutils

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);

I believe slashes in filenames here do not do what you want them to.

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: At wit's end with linker...help please!
  2007-10-31  2:23 At wit's end with linker...help please! Rick Mann
  2007-10-31  2:34 ` Daniel Jacobowitz
@ 2007-10-31  7:35 ` Erik Christiansen
  2007-10-31 23:40   ` Rick Mann
  1 sibling, 1 reply; 5+ messages in thread
From: Erik Christiansen @ 2007-10-31  7:35 UTC (permalink / raw)
  To: Rick Mann; +Cc: binutils

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: At wit's end with linker...help please!
  2007-10-31  2:34 ` Daniel Jacobowitz
@ 2007-10-31 19:03   ` Rick Mann
  0 siblings, 0 replies; 5+ messages in thread
From: Rick Mann @ 2007-10-31 19:03 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: binutils


On Oct 30, 2007, at 7:27 PM, Daniel Jacobowitz wrote:

> I believe slashes in filenames here do not do what you want them to.

Well, without it, it doesn't find start.o, for example (obj/start.o),  
and it worked perfectly before I tried to do the vectors thing. I  
think the other answer is right, that I already included the vectors  
in the wildcard inclusion...

thanks,
Rick

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: At wit's end with linker...help please!
  2007-10-31  7:35 ` Erik Christiansen
@ 2007-10-31 23:40   ` Rick Mann
  0 siblings, 0 replies; 5+ messages in thread
From: Rick Mann @ 2007-10-31 23:40 UTC (permalink / raw)
  To: Erik Christiansen; +Cc: binutils


On Oct 30, 2007, at 7:35 PM, Erik Christiansen wrote:

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

Sigh. Yes. Duh. Thank you!

> 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.)

Thanks, I'll take a look.

-- 
Rick

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-31 19:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-31  2:23 At wit's end with linker...help please! Rick Mann
2007-10-31  2:34 ` Daniel Jacobowitz
2007-10-31 19:03   ` Rick Mann
2007-10-31  7:35 ` Erik Christiansen
2007-10-31 23:40   ` Rick Mann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).