summaryrefslogtreecommitdiffstats
path: root/Python/dynload_shlib.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-10-25 22:07:45 (GMT)
committerGuido van Rossum <guido@python.org>2000-10-25 22:07:45 (GMT)
commitc8fcdcba36dc39587ba08c932a26d38e667744d4 (patch)
treef4cbf8d2156af18aca8f8b846863a07dced562ca /Python/dynload_shlib.c
parentadd8d8632528d104a3a1e653ec815ed2e2c75b7a (diff)
downloadcpython-c8fcdcba36dc39587ba08c932a26d38e667744d4.zip
cpython-c8fcdcba36dc39587ba08c932a26d38e667744d4.tar.gz
cpython-c8fcdcba36dc39587ba08c932a26d38e667744d4.tar.bz2
Patch 102114, Bug 11725. On OpenBSD (but apparently not on the other
BSDs) you need a leading underscore in the dlsym() lookup name.
Diffstat (limited to 'Python/dynload_shlib.c')
-rw-r--r--Python/dynload_shlib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 2b0e74e..28f50b1 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -16,6 +16,12 @@
#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;