diff options
author | Richard Levitte <levitte@openssl.org> | 2003-06-11 22:42:28 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2003-06-11 22:42:28 +0000 |
commit | e666c4599f017c244873a0184807ee22058a70b3 (patch) | |
tree | b35cbc5568cd258e0070c55cf667ef918054a91a /crypto/dso | |
parent | 98cec7fc7b9058aa7a43c3b27591be9a841cead5 (diff) |
Add the possibility to have symbols loaded globally with DSO.
Diffstat (limited to 'crypto/dso')
-rw-r--r-- | crypto/dso/dso.h | 7 | ||||
-rw-r--r-- | crypto/dso/dso_dlfcn.c | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/crypto/dso/dso.h b/crypto/dso/dso.h index 9a1cdabf39..fccf54f960 100644 --- a/crypto/dso/dso.h +++ b/crypto/dso/dso.h @@ -95,6 +95,13 @@ extern "C" { */ #define DSO_FLAG_UPCASE_SYMBOL 0x10 +/* This flag loads the library with public symbols. + * Meaning: The exported symbols of this library are public + * to all libraries loaded after this library. + * At the moment only implemented in unix. + */ +#define DSO_FLAG_GLOBAL_SYMBOLS 0x20 + typedef void (*DSO_FUNC_TYPE)(void); diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c index de88b2fd16..259aee83e7 100644 --- a/crypto/dso/dso_dlfcn.c +++ b/crypto/dso/dso_dlfcn.c @@ -140,13 +140,19 @@ static int dlfcn_load(DSO *dso) void *ptr = NULL; /* See applicable comments in dso_dl.c */ char *filename = DSO_convert_filename(dso, NULL); + int flags = DLOPEN_FLAG; if(filename == NULL) { DSOerr(DSO_F_DLFCN_LOAD,DSO_R_NO_FILENAME); goto err; } - ptr = dlopen(filename, DLOPEN_FLAG); + +#ifdef RTLD_GLOBAL + if (dso->flags & DSO_FLAG_GLOBAL_SYMBOLS) + flags |= RTLD_GLOBAL; +#endif + ptr = dlopen(filename, flags); if(ptr == NULL) { DSOerr(DSO_F_DLFCN_LOAD,DSO_R_LOAD_FAILED); |