From 3a0ecccb599a6b1ad4b149dc569c0080e92d057b Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 8 Feb 2020 19:58:43 +0100 Subject: ld.so: Do not export free/calloc/malloc/realloc functions [BZ #25486] Exporting functions and relying on symbol interposition from libc.so makes the choice of implementation dependent on DT_NEEDED order, which is not what some compiler drivers expect. This commit replaces one magic mechanism (symbol interposition) with another one (preprocessor-/compiler-based redirection). This makes the hand-over from the minimal malloc to the full malloc more explicit. Removing the ABI symbols is backwards-compatible because libc.so is always in scope, and the dynamic loader will find the malloc-related symbols there since commit f0b2132b35248c1f4a80f62a2c38cddcc802aa8c ("ld.so: Support moving versioned symbols between sonames [BZ #24741]"). Reviewed-by: Carlos O'Donell --- include/inline-hashtab.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/inline-hashtab.h') diff --git a/include/inline-hashtab.h b/include/inline-hashtab.h index 3c09978..856719c 100644 --- a/include/inline-hashtab.h +++ b/include/inline-hashtab.h @@ -51,7 +51,7 @@ htab_create (void) return NULL; ht->size = 3; ht->entries = malloc (sizeof (void *) * ht->size); - ht->free = free; + ht->free = __rtld_free; if (! ht->entries) { free (ht); @@ -167,7 +167,7 @@ htab_expand (struct hashtab *htab, int (*hash_fn) (void *)) /* Use the free() corresponding to the malloc() above to free this up. */ - htab->free = free; + htab->free = __rtld_free; return 1; } -- cgit v1.1