R_PPC_REL24 relocation in shared libraries

Geoff Keating geoffk@geoffk.org
Mon Feb 24 19:48:00 GMT 2003


Alan Modra <amodra@bigpond.net.au> writes:

> On Sun, Feb 23, 2003 at 04:11:46PM +0100, Olaf Hering wrote:
> > the linker does allow R_PPC_REL24 relocations in shared libraries. These
> > relocs come from object files compiled without -fPIC. Code compiled
> > without -fPIC is not supposed to work in shared libraries. I think that
> > is true for every *-linux* architecture, but I'm mainly concerned about
> > powerpc-linux.
> 
> Non-PIC code in shared libs is supported by binutils on some other 
> architectures, eg x86, so it's reasonable for the gas testsuite to
> check that non-PIC shared libs work.  Non-PIC shared libs do have some
> disadvantages.  eg. non-PIC shared libs might have relocations in
> read-only segments, causing pages to become unshared, and as you know,
> on powerpc-linux you might also run into problems with branches not
> being able to reach their targets.

Non-PIC code in shared libraries is supposed to work, most of the time
(and certainly well enough for the binutils testsuite) on powerpc-linux.

-- 
- Geoffrey Keating <geoffk@geoffk.org>



More information about the Binutils mailing list