[Python-Dev] Problems with Python's default dlopen flags

Jack Jansen Jack.Jansen@oratrix.com
Sun, 5 May 2002 22:10:32 +0200


On zondag, mei 5, 2002, at 06:08 , Mark Hammond wrote:

>> I'm hoping I can raise some interest in resolving this problem:
>
> Or at least documenting it well :)
>
> I don't understand the issues at all, other than my belief that 
> Linux makes
> it harder than it needs to be.

If I understand correctly it isn't Linux, it's the Python way of 
dynamic loading which makes it more difficult. The way Python 
does dynamic loading is modeled after how old Unix dynamic 
loaders worked (which was mainly a dirty hack without much 
design): you load a .so and at load time it will invoke a 
special version of the "ld" link editor which will at that time 
do symbol resolving, etc.
As this "magic resolving symbols from what happens to be the 
loading application" is so ubiquitous in Unix most current unix 
variants support it, one way or another.

This is a whole different situation from Windows and MacOS, 
which are in this respect more modern, and have a conceptually 
more simple model: you always link against a stub library, and 
at runtime the symbols are always taken from the corresponding 
dynamic library. This is a lot safer (no more symbols that are 
accidentally satisfied from a completely unexpected library, 
version checking, etc) but it can make a few things more 
difficult, such as dynamic modules that refer to each other, or 
loading extension modules into a statically linked program.


--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- 
Emma Goldman -