]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
malloc: Use compat_symbol_reference in libmcheck [BZ #22050]
authorFlorian Weimer <fweimer@redhat.com>
Mon, 16 Oct 2017 18:52:34 +0000 (20:52 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 16 Oct 2017 18:52:34 +0000 (20:52 +0200)
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
malloc/mcheck-init.c

index c10cb9fd22e4266db237088e1e9c731da3ad7955..f860884e148f5c9464fbfa60bbffafb592524d02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-16  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #22050]
+       * malloc/mcheck-init.c (__malloc_initialize_hook): Use
+       compat_symbol_reference to access non-default version.
+
 2017-10-16  Florian Weimer  <fweimer@redhat.com>
 
        * malloc/Makefile (others-extras): Set to mcheck-init.o.
index 6d2492ef7e437bf619c349f3996d1b862dc60192..05bf03241742cf889ce6d90ffb27fa38398e92e7 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <malloc.h>
 #include <mcheck.h>
+#include <shlib-compat.h>
 
 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);