diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-03-01 15:56:36 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-03-01 15:58:01 +0100 |
commit | 9fc813e1a37d2e2d5e85a97d5ac4fc1c15d839fb (patch) | |
tree | 62e5002b97acab6f776476c2325a37097693b0ea /malloc/set-freeres.c | |
parent | 764e9a0334350f52ab6953bef1db97f9b2e89ca5 (diff) | |
download | glibc-9fc813e1a37d2e2d5e85a97d5ac4fc1c15d839fb.tar.gz |
Implement <unwind-link.h> for dynamically loading the libgcc_s unwinder
This will be used to consolidate the libgcc_s access for backtrace
and pthread_cancel.
Unlike the existing backtrace implementations, it provides some
hardening based on pointer mangling.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'malloc/set-freeres.c')
-rw-r--r-- | malloc/set-freeres.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c index 24c7194aa8..817fbea8b8 100644 --- a/malloc/set-freeres.c +++ b/malloc/set-freeres.c @@ -19,6 +19,7 @@ #include <stdlib.h> #include <set-hooks.h> #include <libc-internal.h> +#include <unwind-link.h> #include "../nss/nsswitch.h" #include "../libio/libioP.h" @@ -61,6 +62,10 @@ __libc_freeres (void) if (&__libpthread_freeres != NULL) __libpthread_freeres (); +#ifdef SHARED + __libc_unwind_link_freeres (); +#endif + for (p = symbol_set_first_element (__libc_freeres_ptrs); !symbol_set_end_p (__libc_freeres_ptrs, p); ++p) free (*p); |