libpython and position-independent code

Mats Wichmann mats at laplaza.org
Wed Aug 22 18:42:56 CEST 2001


On Tue, 21 Aug 2001 16:06:36 -0400, "Gregory (Grisha) Trubetskoy"
<grisha at verio.net> wrote:

:
:Hello there -
:
:I am a bit puzzled by what significance PIC code has in shared libraries.
:(This is Solaris 8, but I'm intersted in how this applies to other OS's
:too)
:
:While tinkering with libtool, I found that it wouldn't link libpython into
:a shared library (mod_python.so), because libpython might not be PIC.

Shared libraries need to be PIC (position-independent code) since the
address they're loaded at can't be guaranteed.  Static libraries will
have some final address calculations done when they're bound into the
program by the linker, so they don't need to be PIC.

Mats Wichmann

(Anti-spam stuff: to reply remove the "xyz" from the
address xyzmats at laplaza.org. Not that it helps much...)



More information about the Python-list mailing list