summaryrefslogtreecommitdiff
path: root/malloc/set-freeres.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/set-freeres.c')
-rw-r--r--malloc/set-freeres.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c
index 817fbea8b8..d404250151 100644
--- a/malloc/set-freeres.c
+++ b/malloc/set-freeres.c
@@ -20,6 +20,7 @@
#include <set-hooks.h>
#include <libc-internal.h>
#include <unwind-link.h>
+#include <dlfcn/dlerror.h>
#include "../nss/nsswitch.h"
#include "../libio/libioP.h"
@@ -28,8 +29,6 @@ DEFINE_HOOK (__libc_subfreeres, (void));
symbol_set_define (__libc_freeres_ptrs);
-extern __attribute__ ((weak)) void __libdl_freeres (void);
-
extern __attribute__ ((weak)) void __libpthread_freeres (void);
void __libc_freeres_fn_section
@@ -52,11 +51,6 @@ __libc_freeres (void)
/* We run the resource freeing after IO cleanup. */
RUN_HOOK (__libc_subfreeres, ());
- /* Call the libdl list of cleanup functions
- (weak-ref-and-check). */
- if (&__libdl_freeres != NULL)
- __libdl_freeres ();
-
/* Call the libpthread list of cleanup functions
(weak-ref-and-check). */
if (&__libpthread_freeres != NULL)
@@ -66,6 +60,8 @@ __libc_freeres (void)
__libc_unwind_link_freeres ();
#endif
+ call_function_static_weak (__libc_dlerror_result_free);
+
for (p = symbol_set_first_element (__libc_freeres_ptrs);
!symbol_set_end_p (__libc_freeres_ptrs, p); ++p)
free (*p);