From ccdb048df457d581f6ac7ede8b0c7a593a891dfa Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Wed, 21 Jan 2015 01:51:10 -0500 Subject: Fix recursive dlopen. The ability to recursively call dlopen is useful for malloc implementations that wish to load other dynamic modules that implement reentrant/AS-safe functions to use in their own implementation. Given that a user malloc implementation may be called by an ongoing dlopen to allocate memory the user malloc implementation interrupts dlopen and if it calls dlopen again that's a reentrant call. This patch fixes the issues with the ld.so.cache mapping and the _r_debug assertion which prevent this from working as expected. See: https://sourceware.org/ml/libc-alpha/2014-12/msg00446.html --- sysdeps/generic/ldsodefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 96dec1f436..d738988375 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -905,8 +905,8 @@ extern const struct r_strlenpair *_dl_important_hwcaps (const char *platform, internal_function; /* Look up NAME in ld.so.cache and return the file name stored there, - or null if none is found. */ -extern const char *_dl_load_cache_lookup (const char *name) + or null if none is found. Caller must free returned string. */ +extern char *_dl_load_cache_lookup (const char *name) internal_function; /* If the system does not support MAP_COPY we cannot leave the file open -- cgit 1.4.1