This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: arm-elf linker mishandling R_ARM_REL32 with -shared
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: "Dave Korn" <dk at artimi dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: 15 Apr 2004 11:09:37 -0400
- Subject: Re: arm-elf linker mishandling R_ARM_REL32 with -shared
- References: <NUTMEG9AtFofSCRKosm0000048e@NUTMEG.CAM.ARTIMI.COM>
"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