trawick 01/11/29 20:04:48
Modified: dso/unix dso.c
Log:
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.
Revision Changes Path
1.47 +14 -1 apr/dso/unix/dso.c
Index: dso.c
===================================================================
RCS file: /home/cvs/apr/dso/unix/dso.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- dso.c 2001/11/20 16:31:25 1.46
+++ dso.c 2001/11/30 04:04:48 1.47
@@ -139,7 +139,20 @@
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 */
|