From 7ece6cd509703ee151092a50956dbd45ca1b13da Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 16 Oct 2017 20:52:34 +0200 Subject: malloc: Use compat_symbol_reference in libmcheck [BZ #22050] Since glibc 2.24, __malloc_initialize_hook is a compat symbol. As a result, the link editor does not export a definition of __malloc_initialize_hook from the main program, so that it no longer interposes the variable definition in libc.so. Specifying the symbol version restores the exported symbol. --- ChangeLog | 6 ++++++ malloc/mcheck-init.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index c10cb9fd22..f860884e14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-10-16 Florian Weimer + + [BZ #22050] + * malloc/mcheck-init.c (__malloc_initialize_hook): Use + compat_symbol_reference to access non-default version. + 2017-10-16 Florian Weimer * malloc/Makefile (others-extras): Set to mcheck-init.o. diff --git a/malloc/mcheck-init.c b/malloc/mcheck-init.c index 6d2492ef7e..05bf032417 100644 --- a/malloc/mcheck-init.c +++ b/malloc/mcheck-init.c @@ -20,6 +20,7 @@ #include #include +#include static void turn_on_mcheck (void) @@ -28,3 +29,5 @@ turn_on_mcheck (void) } void (*__malloc_initialize_hook) (void) = turn_on_mcheck; +compat_symbol_reference (libc, __malloc_initialize_hook, + __malloc_initialize_hook, GLIBC_2_0); -- cgit v1.2.3