]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Revert __malloc_initialize_hook symbol poisoning
authorFlorian Weimer <fweimer@redhat.com>
Mon, 20 Jun 2016 09:11:29 +0000 (11:11 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 20 Jun 2016 09:11:29 +0000 (11:11 +0200)
It turns out the Emacs-internal malloc implementation uses
__malloc_* symbols.  If glibc poisons them in <stdc-pre.h>,
Emacs will no longer compile.

ChangeLog
include/stdc-predef.h
malloc/Makefile
malloc/arena.c
malloc/malloc-hooks.h
malloc/malloc.c
malloc/mcheck-init.c

index d610e9badcfb39058b0dc9bcbeab5b030b0a8dc8..58210558cffe9732f2716d23ec653932b3ec97c7 100644 (file)
--- a/ChangeLog
+++ b/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>
 
        * sysdeps/unix/sysv/linux/times.c (__times): Expand comments.
index 52cf8d10a0395db474a63a90a67de20c48ccf5c5..f9f7f731d193a1033370f95cd2ecf156819e29cd 100644 (file)
 /* We do not support C11 <threads.h>.  */
 #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
index 91eb17dd7a23ecb2fc868af360d190e6e62d37ac..fa1730ecb75b9248efc45844ef27ed24c04318f3 100644 (file)
@@ -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)
 
index 64a118c319a28feb4fed1ed19e263c3dd73a0153..ed5a4d5cd33b3ca9d1a47f1aff7550ce79db01d4 100644 (file)
@@ -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
index 3be391b6fb1f7aaa836a25f18bc14cf73db586e9..c7aa8b2d53198a7638b83e592c6f30a5e4e0f58d 100644 (file)
@@ -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 */
index 21a912a6d1e23a7caba3ea258fb86cf23a383b13..1f5f166ea2ecdf601546b4157e3a291dd5c330a4 100644 (file)
@@ -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,
index 3218bb03b997e3df1bd886950a8b232a89fe7b23..8d63dd348829ec43707e991b98b00f0ef052ba33 100644 (file)
@@ -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;