Michael Felt added the comment:

re:

AIX: CDLL("libcrypto.a(libcrypto.so.1.0.0)", DEFAULT_MODE | RTLD_MEMBER)

Officially it would be
dlopen("libcrypto.a(libcrypto.so.1.0.0)", RTLD_NOW | RTLD_MEMBER)

Further, that would only load the 32-bit version, as there is a legacy naming 
scheme for the 64-bit members (the same name may actually occur twice - once 
for each size)

Example: the ar command showing all members regardless of size:
root@x064:[/]ar -Xany tv /usr/lib/libcrypto.a
rwxr-xr-x     0/0     2967588 Jul 24 13:46 2015 libcrypto.so
rwxr-xr-x     0/0     2256131 Jul 24 13:43 2015 libcrypto.so.0.9.8
rwxr-xr-x     0/0     2967588 Jul 24 13:45 2015 libcrypto.so.1.0.0
rwxr-xr-x     0/0     3376521 Jul 24 13:46 2015 libcrypto64.so
rwxr-xr-x     0/0     2606185 Jul 24 13:44 2015 libcrypto64.so.0.9.8
rwxr-xr-x     0/0     3376521 Jul 24 13:45 2015 libcrypto64.so.1.0.0

Note: the default archives (ending in .so) are "same size, checksum, etc" as 
the .so.1.0.0 versioned members.

Also, this can be more complex - e.g., if LibreSSL is also included (I am 
re-working my packaging so that I will also have both 32 and 64-bit packaging, 
for now only 32-bit is available)

michael@x071:[/home/michael]ar -X32 tv /opt/lib/libcrypto.a
rwxr-xr-x     0/0     3060762 Jun 17 21:17 2015 libcrypto.so.33
rwxrwxr-x     0/0     2965597 Jul 25 16:57 2015 libcrypto.so
rwxrwxr-x     0/0     2253850 Jul 25 17:03 2015 libcrypto.so.0.9.8
rwxrwxr-x     0/0     2965597 Jul 25 17:03 2015 libcrypto.so.1.0.0

IMHO: this is a needless complication for a programmer using ctypes.cdll - but 
who am I?

>From the dlopen man page (aka InfoCenter)

Flags: (aka mode)
Specifies variations of the behavior of dlopen. Either RTLD_NOW or RTLD_LAZY 
must always be specified. Other flags may be OR'ed with RTLD_NOW or RTLD_LAZY.

RTLD_NOW        Load all dependents of the module being loaded and resolve all 
symbols.

RTLD_LAZY       Specifies the same behavior as RTLD_NOW. In a future release of 
the operating system, the behavior of the RTLD_LAZY may change so that loading 
of dependent modules is deferred of resolution of some symbols is deferred.

RTLD_MEMBER     The dlopen subroutine can be used to load a module that is a 
member of an archive. The L_LOADMEMBER flag is used when the load subroutine is 
called. The module name FilePath names the archive and archive member according 
to the rules outlined in the load subroutine.

To be complete...

RTLD_GLOBAL     Allows symbols in the module being loaded to be visible when 
resolving symbols used by other dlopen calls. These symbols will also be 
visible when the main application is opened with dlopen(NULL, mode).

RTLD_LOCAL      Prevent symbols in the module being loaded from being used when 
resolving symbols used by other dlopen calls. Symbols in the module being 
loaded can only be accessed by calling dlsym subroutine. 

If neither RTLD_GLOBAL nor RTLD_LOCAL is specified, the default is RTLD_LOCAL. 
If both flags are specified, RTLD_LOCAL is ignored.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26439>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to