only prepend underscore to symbol names when doing dlsym() on a.out

OpenBSD architectures - fixes ELF plugin loading; ok jakob
This commit is contained in:
pvalchev 2002-07-20 18:33:21 +00:00
parent 73890077de
commit 1e1250aa38

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-lib_dlopen_c,v 1.1 2002/07/20 18:33:21 pvalchev Exp $
--- lib/dlopen.c.orig Sun Jul 7 15:13:39 2002
+++ lib/dlopen.c Sun Jul 7 15:14:43 2002
@@ -157,7 +157,7 @@ int _sasl_locate_entry(void *library, co
{
/* note that we still check for known problem systems in
* case we are cross-compiling */
-#if defined(DLSYM_NEEDS_UNDERSCORE) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(DLSYM_NEEDS_UNDERSCORE) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__)
char adj_entryname[1024];
#else
#define adj_entryname entryname
@@ -181,7 +181,7 @@ int _sasl_locate_entry(void *library, co
return SASL_BADPARAM;
}
-#if defined(DLSYM_NEEDS_UNDERSCORE) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(DLSYM_NEEDS_UNDERSCORE) || (defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__)
snprintf(adj_entryname, sizeof adj_entryname, "_%s", entryname);
#endif