summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-11-17 12:20:29 +0100
committerFlorian Weimer <fweimer@redhat.com>2021-11-17 12:20:29 +0100
commitf1d333b5bfdb3561c93feb4b5653d051c3258c59 (patch)
treea7a2e391beed00f8daa4cc826a10d0c6a26240fd /malloc
parent8bd336a00a5311bf7a9e99b3b0e9f01ff5faa74b (diff)
downloadglibc-f1d333b5bfdb3561c93feb4b5653d051c3258c59.tar.gz
glibc-f1d333b5bfdb3561c93feb4b5653d051c3258c59.tar.xz
glibc-f1d333b5bfdb3561c93feb4b5653d051c3258c59.zip
elf: Introduce GLRO (dl_libc_freeres), called from __libc_freeres
This will be used to deallocate memory allocated using the non-minimal
malloc.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'malloc')
-rw-r--r--malloc/set-freeres.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c
index 5c19a2725c..856ff7831f 100644
--- a/malloc/set-freeres.c
+++ b/malloc/set-freeres.c
@@ -21,6 +21,7 @@
 #include <libc-internal.h>
 #include <unwind-link.h>
 #include <dlfcn/dlerror.h>
+#include <ldsodefs.h>
 
 #include "../nss/nsswitch.h"
 #include "../libio/libioP.h"
@@ -67,6 +68,10 @@ __libc_freeres (void)
 
       call_function_static_weak (__libc_dlerror_result_free);
 
+#ifdef SHARED
+      GLRO (dl_libc_freeres) ();
+#endif
+
       for (p = symbol_set_first_element (__libc_freeres_ptrs);
            !symbol_set_end_p (__libc_freeres_ptrs, p); ++p)
         free (*p);