Relocation question (was: RE: Unsupported targets slated for removal)

Dave Korn dave.korn@artimi.com
Wed Apr 6 10:40:00 GMT 2005


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



More information about the Binutils mailing list