]> granicus.if.org Git - python/commitdiff
Patch 102114, Bug 11725. On OpenBSD (but apparently not on the other
authorGuido van Rossum <guido@python.org>
Wed, 25 Oct 2000 22:07:45 +0000 (22:07 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 25 Oct 2000 22:07:45 +0000 (22:07 +0000)
BSDs) you need a leading underscore in the dlsym() lookup name.

Python/dynload_shlib.c

index 2b0e74ee17f306d6877cc16591f1f779a6d6c53b..28f50b1f76eada6f2a610c05a6c861eb9c37032b 100644 (file)
 #endif
 #endif
 
+#ifdef __OpenBSD__
+#define LEAD_UNDERSCORE "_"
+#else
+#define LEAD_UNDERSCORE ""
+#endif
+
 #ifndef RTLD_LAZY
 #define RTLD_LAZY 1
 #endif
@@ -54,8 +60,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
                pathname = pathbuf;
        }
 
-       /* ### should there be a leading underscore for some platforms? */
-       sprintf(funcname, "init%.200s", shortname);
+       sprintf(funcname, LEAD_UNDERSCORE "init%.200s", shortname);
 
        if (fp != NULL) {
                int i;