Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8fcdcb

Browse files
committed
Patch 102114, Bug 11725. On OpenBSD (but apparently not on the other
BSDs) you need a leading underscore in the dlsym() lookup name.
1 parent add8d86 commit c8fcdcb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Python/dynload_shlib.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
#endif
1717
#endif
1818

19+
#ifdef __OpenBSD__
20+
#define LEAD_UNDERSCORE "_"
21+
#else
22+
#define LEAD_UNDERSCORE ""
23+
#endif
24+
1925
#ifndef RTLD_LAZY
2026
#define RTLD_LAZY 1
2127
#endif
@@ -54,8 +60,7 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
5460
pathname = pathbuf;
5561
}
5662

57-
/* ### should there be a leading underscore for some platforms? */
58-
sprintf(funcname, "init%.200s", shortname);
63+
sprintf(funcname, LEAD_UNDERSCORE "init%.200s", shortname);
5964

6065
if (fp != NULL) {
6166
int i;

0 commit comments

Comments
 (0)