summaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-06-20 11:11:29 +0200
committerFlorian Weimer <fweimer@redhat.com>2016-06-20 11:11:29 +0200
commit92e1ab0eb58c57d5843fa982ff6c24f551f2f634 (patch)
treee9080190c7a4e80722d4d30ca22ed55bc09bff09 /malloc
parente3c0687de17a97e5dcd991841b54bec181b30e90 (diff)
downloadglibc-92e1ab0eb58c57d5843fa982ff6c24f551f2f634.tar.gz
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.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/Makefile14
-rw-r--r--malloc/arena.c2
-rw-r--r--malloc/malloc-hooks.h5
-rw-r--r--malloc/malloc.c6
-rw-r--r--malloc/mcheck-init.c2
5 files changed, 6 insertions, 23 deletions
diff --git a/malloc/Makefile b/malloc/Makefile
index 91eb17dd7a..fa1730ecb7 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -115,20 +115,6 @@ endif
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-obstack.c = $(uses-callbacks)
diff --git a/malloc/arena.c b/malloc/arena.c
index 64a118c319..ed5a4d5cd3 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -341,7 +341,7 @@ ptmalloc_init (void)
__malloc_check_init ();
}
#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)
(*hook)();
#endif
diff --git a/malloc/malloc-hooks.h b/malloc/malloc-hooks.h
index 3be391b6fb..c7aa8b2d53 100644
--- a/malloc/malloc-hooks.h
+++ b/malloc/malloc-hooks.h
@@ -19,9 +19,6 @@
#ifndef _MALLOC_HOOKS_H
#define _MALLOC_HOOKS_H
-/* These hooks are no longer part of the public API and are poisoned
- 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);
+void (*__malloc_initialize_hook) (void);
#endif /* _MALLOC_HOOKS_H */
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 21a912a6d1..1f5f166ea2 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1851,9 +1851,9 @@ static void *memalign_hook_ini (size_t alignment, size_t sz,
const void *caller) __THROW;
#if HAVE_MALLOC_INIT_HOOK
-void weak_variable (*old__malloc_initialize_hook) (void) = NULL;
-compat_symbol (libc, old__malloc_initialize_hook,
- old__malloc_initialize_hook, GLIBC_2_0);
+void weak_variable (*__malloc_initialize_hook) (void) = NULL;
+compat_symbol (libc, __malloc_initialize_hook,
+ __malloc_initialize_hook, GLIBC_2_0);
#endif
void weak_variable (*__free_hook) (void *__ptr,
diff --git a/malloc/mcheck-init.c b/malloc/mcheck-init.c
index 3218bb03b9..8d63dd3488 100644
--- a/malloc/mcheck-init.c
+++ b/malloc/mcheck-init.c
@@ -27,4 +27,4 @@ turn_on_mcheck (void)
mcheck (NULL);
}
-void (*old__malloc_initialize_hook) (void) = turn_on_mcheck;
+void (*__malloc_initialize_hook) (void) = turn_on_mcheck;