This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arm-elf linker mishandling R_ARM_REL32 with -shared


"Dave Korn" <dk@artimi.com> writes:

> > -----Original Message-----
> > From: binutils-owner On Behalf Of Phil Blundell
> > Sent: 15 April 2004 15:03
> 
> > Consider a source file:
> > 
> > 	.text
> > 	.word	sym - .
> > 
> > 	.bss
> > sym:
> > 	.word	0
> > 
> > If this is assembled and then linked -shared, the resulting 
> > .so ends up
> > with a bogus R_ARM_RELATIVE relocation in .text.
> 
> 
>   What's bogus about it?

After a shared library is linked, the distance between .bss and .text
is fixed, so the value of ".word sym - ." is completely determined.
It should not change depending upon where the shared library is loaded
into memory.  But that is exactly the effect of the R_ARM_RELATIVE
relocation.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]