[parisc-linux] Incompatibility of PIC and non-PIC

Alan Modra alan@linuxcare.com.au
Wed, 13 Sep 2000 11:30:18 +1100 (EST)

On Tue, 12 Sep 2000, Cary Coutant wrote:

> >Shared libraries work well, but we've got a bigger problem now.  Our
> >PIC and non-PIC code models are mutually incompatible in a big way
> >(due to the use of %r19 And, it seems, while it's fine if non-PIC
> >can't be used in shared libraries, it's not all right if PIC can't be
> >linked statically.
> > ...
> >For that matter how does 32-bit HP/UX solve this issue?
> When the HP-UX linker is building an a.out, it converts any r19-relative 
> references into dp-relative references by rewriting the instructions. It 
> still creates a linkage table entry if necessary (i.e., it doesn't 
> rewrite a DLT-indirect reference as a direct dp-relative reference), but 
> the linkage table entries are accessed via the dp register instead of r19.

That's not too bad a hack.  I took a different approach and generate
import stubs when PIC code is detected during a static link.  David, is
there some problem with this (or was this a very old email that Cary was
replying to)?

Alan Modra
Linuxcare.  Support for the Revolution.