mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
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.
This commit is contained in:
@ -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>
|
2017-10-16 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
* malloc/Makefile (others-extras): Set to mcheck-init.o.
|
* malloc/Makefile (others-extras): Set to mcheck-init.o.
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <mcheck.h>
|
#include <mcheck.h>
|
||||||
|
#include <shlib-compat.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
turn_on_mcheck (void)
|
turn_on_mcheck (void)
|
||||||
@ -28,3 +29,5 @@ turn_on_mcheck (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void (*__malloc_initialize_hook) (void) = turn_on_mcheck;
|
void (*__malloc_initialize_hook) (void) = turn_on_mcheck;
|
||||||
|
compat_symbol_reference (libc, __malloc_initialize_hook,
|
||||||
|
__malloc_initialize_hook, GLIBC_2_0);
|
||||||
|
Reference in New Issue
Block a user