summaryrefslogtreecommitdiffstats
path: root/Python/importdl.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-08-04 18:00:12 (GMT)
committerGuido van Rossum <guido@python.org>1999-08-04 18:00:12 (GMT)
commit933c91ebcf476df9a4be51fe13a8e9702b5c82b3 (patch)
treee9e4198b4e8a383688227eb33ee11ad49e805153 /Python/importdl.c
parent58c5a2a53c2a7f95a31c1e2dc7de987fd60ce9d0 (diff)
downloadcpython-933c91ebcf476df9a4be51fe13a8e9702b5c82b3.zip
cpython-933c91ebcf476df9a4be51fe13a8e9702b5c82b3.tar.gz
cpython-933c91ebcf476df9a4be51fe13a8e9702b5c82b3.tar.bz2
Vladimir Marangozov fixes an AIX-specific problem, writing:
""" Following up Robin Dunn's troubles with freeze, here's a patch that fixes an oddity regarding the import logic of shared modules on AIX. Symbol resolution of shared modules is now handled properly for the cases when the python library is linked to a binary with an arbitrary name. This includes the standard python[version] executable, but also applications that are embedding the python core (i.e. linked with libpython[version].a, the latter being static or shared). """
Diffstat (limited to 'Python/importdl.c')
-rw-r--r--Python/importdl.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index 3b43bbc..a40d084 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -898,6 +898,7 @@ aix_getoldmodules(modlistptr)
register char *ldibuf;
register int errflag, bufsize = 1024;
register unsigned int offset;
+ char *progname = Py_GetProgramName();
/*
-- Get the list of loaded modules into ld_info structures.
@@ -925,11 +926,13 @@ aix_getoldmodules(modlistptr)
ldiptr = (struct ld_info *)ldibuf;
prevmodptr = NULL;
do {
- if (strstr(ldiptr->ldinfo_filename, "python") == NULL) {
+ if (strstr(progname, ldiptr->ldinfo_filename) == NULL &&
+ strstr(ldiptr->ldinfo_filename, "python") == NULL) {
/*
- -- Extract only the modules containing "python" as a
- -- substring, like the "python[version]" executable or
- -- "libpython[version].a" in case python is embedded.
+ -- Extract only the modules belonging to the main
+ -- executable + those containing "python" as a
+ -- substring (like the "python[version]" binary or
+ -- "libpython[version].a" in case it's a shared lib).
*/
offset = (unsigned int)ldiptr->ldinfo_next;
ldiptr = (struct ld_info *)((unsigned int)