Incompatibility of PIC and non-PIC

David Huggins-Daines
18 Aug 2000 13:25:53 -0400

Alan Modra <> writes:

> On Fri, 18 Aug 2000, Alan Modra wrote:
> > One way to keep out current ABI is to generate a .plt and import stubs
> > when statically linking PIC code.  That should be relatively easy to do in
> > the linker.
> A bit of head-scratching, a couple of added functions, and the linker now
> detects PIC functions and handles them appropriately.

Sorry to burst your bubble but this doesn't work in the real world,
where "real world" is defined as 'hppa-linux-gcc -o hello hello.c'

In fact this new linker ends up marking basically everything as
potentially PIC, creating unnecessary import stubs for most functions
in libc.a, and *not* actually switching the relocations to point to
import stubs in the case where I am actually calling PIC in libgcc.a.

Oh and it segfaults on undefined weak symbols though that's easily

I'm not even sure where to start fixing this.  I guess I'll try to
find something else to do today :(

Linuxcare. Support for the revolution.