Support a special pathname syntax for apr_dso_load()/dlopen() so · apache/apr@c27f8d2

Original file line numberDiff line numberDiff line change

@@ -139,7 +139,20 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle,

139139

void *os_handle = dlopen((char *)path, RTLD_NOW | RTLD_GLOBAL);

140140
141141

#else

142-

void *os_handle = dlopen(path, RTLD_NOW | RTLD_GLOBAL);

142+

int flags = RTLD_NOW | RTLD_GLOBAL;

143+

void *os_handle;

144+

#ifdef _AIX

145+

if (strchr(path + 1, '(') && path[strlen(path) - 1] == ')')

146+

{

147+

/* This special archive.a(dso.so) syntax is required for

148+

* the way libtool likes to build shared libraries on AIX.

149+

* dlopen() support for such a library requires that the

150+

* RTLD_MEMBER flag be enabled.

151+

*/

152+

flags |= RTLD_MEMBER;

153+

}

154+

#endif

155+

os_handle = dlopen(path, flags);

143156

#endif

144157

#endif /* DSO_USE_x */

145158