$OpenBSD: patch-lib_dlopen_c,v 1.2 2002/12/10 08:37:42 jakob Exp $
--- lib/dlopen.c.orig	Thu Sep  5 21:21:14 2002
+++ lib/dlopen.c	Tue Dec 10 00:10:52 2002
@@ -165,7 +165,7 @@ int _sasl_locate_entry(void *library, co
 #ifdef DO_DLOPEN
 /* 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
@@ -189,7 +189,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
 
