mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Revert __malloc_initialize_hook symbol poisoning
It turns out the Emacs-internal malloc implementation uses __malloc_* symbols. If glibc poisons them in <stdc-pre.h>, Emacs will no longer compile.
This commit is contained in:
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
2016-06-20 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
|
Revert symbol poisoning of __malloc_initialize_hook.
|
||||||
|
* include/stdc-predef.h (__malloc_initialize_hook): Remove
|
||||||
|
poisoning.
|
||||||
|
* malloc/Makefile: Remove un-poisoning.
|
||||||
|
* malloc/arena.c (ptmalloc_init): Use __malloc_initialize_hook
|
||||||
|
instead of old__malloc_initialize_hook.
|
||||||
|
* malloc/malloc-hooks.h: Likewise.
|
||||||
|
* malloc/malloc.c: Likewise.
|
||||||
|
* malloc/mcheck-init.c: Likewise.
|
||||||
|
|
||||||
2016-06-19 Carlos O'Donell <carlos@redhat.com>
|
2016-06-19 Carlos O'Donell <carlos@redhat.com>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/times.c (__times): Expand comments.
|
* sysdeps/unix/sysv/linux/times.c (__times): Expand comments.
|
||||||
|
@ -57,11 +57,4 @@
|
|||||||
/* We do not support C11 <threads.h>. */
|
/* We do not support C11 <threads.h>. */
|
||||||
#define __STDC_NO_THREADS__ 1
|
#define __STDC_NO_THREADS__ 1
|
||||||
|
|
||||||
/* Remove symbols from the API which can be interposed. */
|
|
||||||
#if defined (__GNUC__)
|
|
||||||
# if __GNUC__ >= 4
|
|
||||||
# pragma GCC poison __malloc_initialize_hook
|
|
||||||
# endif /* __GNUC__ >= 4 */
|
|
||||||
#endif /* __GNUC__ */
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -115,20 +115,6 @@ endif
|
|||||||
|
|
||||||
include ../Rules
|
include ../Rules
|
||||||
|
|
||||||
# Support references to removed APIs. We use #pragma GCC poison in
|
|
||||||
# <stdc-predef.h> to make it difficult to reference them. For select
|
|
||||||
# source files, we work around this poisoning by defining a macro on
|
|
||||||
# the command line (which is processed before <stdc-predef.h> and can
|
|
||||||
# therefore use tokens poisoned later).
|
|
||||||
poisoned_apis = \
|
|
||||||
__malloc_initialize_hook \
|
|
||||||
|
|
||||||
unpoisoned_api_defines := \
|
|
||||||
$(foreach sym,$(poisoned_apis), \
|
|
||||||
$(patsubst %,-Dold%, $(sym))=$(sym))
|
|
||||||
CPPFLAGS-malloc.c = $(unpoisoned_api_defines)
|
|
||||||
CPPFLAGS-mcheck-init.c = $(unpoisoned_api_defines)
|
|
||||||
|
|
||||||
CFLAGS-mcheck-init.c = $(PIC-ccflag)
|
CFLAGS-mcheck-init.c = $(PIC-ccflag)
|
||||||
CFLAGS-obstack.c = $(uses-callbacks)
|
CFLAGS-obstack.c = $(uses-callbacks)
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ ptmalloc_init (void)
|
|||||||
__malloc_check_init ();
|
__malloc_check_init ();
|
||||||
}
|
}
|
||||||
#if HAVE_MALLOC_INIT_HOOK
|
#if HAVE_MALLOC_INIT_HOOK
|
||||||
void (*hook) (void) = atomic_forced_read (old__malloc_initialize_hook);
|
void (*hook) (void) = atomic_forced_read (__malloc_initialize_hook);
|
||||||
if (hook != NULL)
|
if (hook != NULL)
|
||||||
(*hook)();
|
(*hook)();
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,9 +19,6 @@
|
|||||||
#ifndef _MALLOC_HOOKS_H
|
#ifndef _MALLOC_HOOKS_H
|
||||||
#define _MALLOC_HOOKS_H
|
#define _MALLOC_HOOKS_H
|
||||||
|
|
||||||
/* These hooks are no longer part of the public API and are poisoned
|
void (*__malloc_initialize_hook) (void);
|
||||||
in <stdc-predef.h>. Their names here reflect the command-line
|
|
||||||
mapping which is used inside glibc to get past the poisoning. */
|
|
||||||
void (*old__malloc_initialize_hook) (void);
|
|
||||||
|
|
||||||
#endif /* _MALLOC_HOOKS_H */
|
#endif /* _MALLOC_HOOKS_H */
|
||||||
|
@ -1851,9 +1851,9 @@ static void *memalign_hook_ini (size_t alignment, size_t sz,
|
|||||||
const void *caller) __THROW;
|
const void *caller) __THROW;
|
||||||
|
|
||||||
#if HAVE_MALLOC_INIT_HOOK
|
#if HAVE_MALLOC_INIT_HOOK
|
||||||
void weak_variable (*old__malloc_initialize_hook) (void) = NULL;
|
void weak_variable (*__malloc_initialize_hook) (void) = NULL;
|
||||||
compat_symbol (libc, old__malloc_initialize_hook,
|
compat_symbol (libc, __malloc_initialize_hook,
|
||||||
old__malloc_initialize_hook, GLIBC_2_0);
|
__malloc_initialize_hook, GLIBC_2_0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void weak_variable (*__free_hook) (void *__ptr,
|
void weak_variable (*__free_hook) (void *__ptr,
|
||||||
|
@ -27,4 +27,4 @@ turn_on_mcheck (void)
|
|||||||
mcheck (NULL);
|
mcheck (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void (*old__malloc_initialize_hook) (void) = turn_on_mcheck;
|
void (*__malloc_initialize_hook) (void) = turn_on_mcheck;
|
||||||
|
Reference in New Issue
Block a user