summaryrefslogtreecommitdiff
path: root/dso/unix
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2001-11-30 04:04:48 +0000
committerJeff Trawick <trawick@apache.org>2001-11-30 04:04:48 +0000
commit26212ae7b1b0d7db3f3526e43b450025cb66218d (patch)
treee58ef898a59639ffdba98f9efafa6984f84c4ba6 /dso/unix
parent803aa3065281f3654b3de98aad37f85a51a19f19 (diff)
downloadapr-26212ae7b1b0d7db3f3526e43b450025cb66218d.tar.gz
Support a special pathname syntax for apr_dso_load()/dlopen() so
that an APR app can open shared libraries that for whatever reason (e.g., libtool) have been stuffed in an archive. This special archive.a(dso.so) syntax is required for the way libtool likes to build shared libraries on AIX. dlopen() support for such a library requires that the RTLD_MEMBER flag be enabled. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62582 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso/unix')
-rw-r--r--dso/unix/dso.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/dso/unix/dso.c b/dso/unix/dso.c
index f9786454c..a8a54be48 100644
--- a/dso/unix/dso.c
+++ b/dso/unix/dso.c
@@ -139,7 +139,20 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,
void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL);
#else
- void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
+ int flags = RTLD_NOW | RTLD_GLOBAL;
+ void *os_handle;
+#ifdef _AIX
+ if (strchr(path + 1, '(') && path[strlen(path) - 1] == ')')
+ {
+ /* This special archive.a(dso.so) syntax is required for
+ * the way libtool likes to build shared libraries on AIX.
+ * dlopen() support for such a library requires that the
+ * RTLD_MEMBER flag be enabled.
+ */
+ flags |= RTLD_MEMBER;
+ }
+#endif
+ os_handle = dlopen(path, flags);
#endif
#endif /* DSO_USE_x */