[Python-Dev] Handling linker scripts reached when dynamically loading a module

"Martin v. Löwis" martin at v.loewis.de
Sun Sep 11 09:08:29 CEST 2011


> Let me clarify: This will only be a problem when using a foreign
> function interface to call a non-versioned module dynamically.

As such, it won't be much of a problem for Python. In Python, we
don't normally dlopen .so files, except when we know they are
Python extension modules, in which case we also know that they won't
be linker scripts - it just doesn't make sense to write a linker script
for what should be a Python module, since you won't ever link against
Python modules.

The only case where it might matter is ctypes, which is Python's
"dynamic" FFI (as opposed to the C API, which is the "static" FFI).
However, those libraries which are often wrapped with linker scripts
don't typically get used in ctypes - e.g. libpthread won't be used in
ctypes, but along with the thread module. The only common case where
a library that is often a linker script gets also often used in ctypes
(i.e. libc) is already special-cased - ctypes knows how to find the
"real" C library.

IOW, I would defer this until it becomes a real problem, at what
point whoever has that problem ought to provide a patch.

Regards,
Martin


More information about the Python-Dev mailing list