summaryrefslogtreecommitdiffstats
path: root/crypto/dso
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2000-06-21 14:12:25 +0000
committerGeoff Thorpe <geoff@openssl.org>2000-06-21 14:12:25 +0000
commit1a797ac67ca917b617496fe40b9b17aa50f75ee8 (patch)
tree2afcb09000184d4bff0592889c81901b9e69ab70 /crypto/dso
parent130832150c1313824868b154cccda3ace88fa950 (diff)
* This adds some checking to the 'dlfcn' DSO_METHOD that at least lets
it cope with OpenBSD which doesn't understand "RTLD_NOW". * Added the dso_scheme config string entry for OpenBSD-x86 to give it DSO support. * 'make update' that has also absorbed some of Steve's mkstack changes for the ASN-related macros.
Diffstat (limited to 'crypto/dso')
-rw-r--r--crypto/dso/dso_dlfcn.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
index c12583cdc4..e709c721cc 100644
--- a/crypto/dso/dso_dlfcn.c
+++ b/crypto/dso/dso_dlfcn.c
@@ -106,6 +106,26 @@ DSO_METHOD *DSO_METHOD_dlfcn(void)
return(&dso_meth_dlfcn);
}
+/* Prior to using the dlopen() function, we should decide on the flag
+ * we send. There's a few different ways of doing this and it's a
+ * messy venn-diagram to match up which platforms support what. So
+ * as we don't have autoconf yet, I'm implementing a hack that could
+ * be hacked further relatively easily to deal with cases as we find
+ * them. Initially this is to cope with OpenBSD. */
+#ifdef __OpenBSD__
+# ifdef DL_LAZY
+# define DLOPEN_FLAG DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define DLOPEN_FLAG RTLD_NOW
+# else
+# define DLOPEN_FLAG 0
+# endif
+# endif
+#else
+# define DLOPEN_FLAG RTLD_NOW /* Hope this works everywhere else */
+#endif
+
/* For this DSO_METHOD, our meth_data STACK will contain;
* (i) the handle (void*) returned from dlopen().
*/
@@ -126,11 +146,11 @@ static int dlfcn_load(DSO *dso, const char *filename)
(strstr(filename, "/") == NULL))
{
sprintf(translated, "lib%s.so", filename);
- ptr = dlopen(translated, RTLD_NOW);
+ ptr = dlopen(translated, DLOPEN_FLAG);
}
else
{
- ptr = dlopen(filename, RTLD_NOW);
+ ptr = dlopen(filename, DLOPEN_FLAG);
}
if(ptr == NULL)
{