summaryrefslogtreecommitdiff
path: root/dso
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2001-11-30 04:04:48 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2001-11-30 04:04:48 +0000
commit5b7eecb872b01a0456900f7679a12f30046c8c92 (patch)
treee58ef898a59639ffdba98f9efafa6984f84c4ba6 /dso
parent28a901c4b0ed6229b39a69b66fe61d6e8693f944 (diff)
downloadlibapr-5b7eecb872b01a0456900f7679a12f30046c8c92.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: http://svn.apache.org/repos/asf/apr/apr/trunk@62582 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso')
-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 */