This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: Relocation question (was: RE: Unsupported targets slated for removal)
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Christian Groessler'" <chris at groessler dot org>,<binutils at sources dot redhat dot com>
- Date: Wed, 6 Apr 2005 11:40:30 +0100
- Subject: RE: Relocation question (was: RE: Unsupported targets slated for removal)
----Original Message----
>From: Christian Groessler
>Sent: 06 April 2005 11:24
> While doing this I've encountered the following problem. Consider this
> source file:
>
> .text
> .long INITFN
> INITFN: nop
> If I compile it with the old assembler, I get the following relocation
> entry in the object file:
> RELOCATION RECORDS FOR [.text]:
> OFFSET TYPE VALUE
> 00000000 r_imm32 INITFN
> If I compile it with my BFD_ASSEMBLER modified version, I get
> RELOCATION RECORDS FOR [.text]:
> OFFSET TYPE VALUE
> 00000000 r_imm32 .text
> Please note the different VALUEs.
> Shouldn't the VALUE be INITFN, like in the old non-bfd assembler?
This sounds like a REL-vs-RELA issue to me. Perhaps the old assembler
produces a reloc with a value of 4, and places a zero in the .long at offset
0 in the .text section, while the new one produces a reloc with a value of
zero, and places the value 4 in the .long at offset 0 in the .text section?
You may need to switch the linker over if this is the case, or perhaps there
is an assumption in BFD_ASSEMBLER that the linker uses one format rather
than the other that isn't justified in this case?
cheers,
DaveK
--
Can't think of a witty .sigline today....