Subject: Re: Unsupported relocation type 10 in non-PLT relocations
To: None <port-macppc@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: port-macppc
Date: 03/12/2001 03:07:18
In article <1eq4kud.2bmqyzfx84a7M@[10.0.12.137]>,
Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr> wrote:
>> > Unsupported relocation type 10 in non-PLT relocations
>> This is generally caused by linking non-PIC code into a shared library.
>
>Is there any way of finding what is PIC and what is not in a shared
>object? I have trouble to track down the cause of the problem.

This is not intended to be an explanation of dynamic linking... Just
glossing over some terms.

PIC == position independent code

It is generated with -fpic or -kpic in some compilers/assemblers.
It basically creates relative jumps instead of absolute and calls
procedures indirectly so that the code can be loaded at any address.
There is also -fPIC and -KPIC that can handler longer branches.

PLT == procedure linkage table. It is the indirection table from where
procedures are called.

The dynamic linker at startup fixes up all the references in the table
and handles all unresolved relocations.

What the error means, is that there is an object file that was not generated
with -fpic in a shared library and the dynamic linker is bitching that it
can not fix a relocation that is invalid in a PIC context.

christos