about summary refs log tree commit diff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-02-08 19:58:43 +0100
committerFlorian Weimer <fweimer@redhat.com>2020-02-15 11:01:23 +0100
commit3a0ecccb599a6b1ad4b149dc569c0080e92d057b (patch)
treee1c4c0e5f2e80221054d6bb6260b4038e27567b4 /sysdeps/mach
parent2efa52c880d46ee89523c8ed8102ceeb02043926 (diff)
downloadglibc-3a0ecccb599a6b1ad4b149dc569c0080e92d057b.tar.gz
glibc-3a0ecccb599a6b1ad4b149dc569c0080e92d057b.tar.xz
glibc-3a0ecccb599a6b1ad4b149dc569c0080e92d057b.zip
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 <carlos@redhat.com>
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/hurd/i386/ld.abilist4
-rw-r--r--sysdeps/mach/hurd/i386/localplt.data6
2 files changed, 0 insertions, 10 deletions
diff --git a/sysdeps/mach/hurd/i386/ld.abilist b/sysdeps/mach/hurd/i386/ld.abilist
index c76b913486..6f591b2496 100644
--- a/sysdeps/mach/hurd/i386/ld.abilist
+++ b/sysdeps/mach/hurd/i386/ld.abilist
@@ -16,10 +16,6 @@ GLIBC_2.2.6 _dl_mcount F
 GLIBC_2.2.6 _hurd_intr_rpc_mach_msg F
 GLIBC_2.2.6 _r_debug D 0x14
 GLIBC_2.2.6 abort F
-GLIBC_2.2.6 calloc F
-GLIBC_2.2.6 free F
-GLIBC_2.2.6 malloc F
-GLIBC_2.2.6 realloc F
 GLIBC_2.3 ___tls_get_addr F
 GLIBC_2.3 __tls_get_addr F
 GLIBC_2.4 __stack_chk_guard D 0x4
diff --git a/sysdeps/mach/hurd/i386/localplt.data b/sysdeps/mach/hurd/i386/localplt.data
index c1725d140f..102323e64f 100644
--- a/sysdeps/mach/hurd/i386/localplt.data
+++ b/sysdeps/mach/hurd/i386/localplt.data
@@ -9,12 +9,6 @@ libc.so: malloc + REL R_386_GLOB_DAT
 libc.so: memalign + REL R_386_GLOB_DAT
 libc.so: realloc + REL R_386_GLOB_DAT
 libm.so: matherr + REL R_386_GLOB_DAT
-# The main malloc is interposed into the dynamic linker, for
-# allocations after the initial link (when dlopen is used).
-ld.so: malloc + REL R_386_GLOB_DAT
-ld.so: calloc + REL R_386_GLOB_DAT
-ld.so: realloc + REL R_386_GLOB_DAT
-ld.so: free + REL R_386_GLOB_DAT
 # The TLS-enabled version of these functions is interposed from libc.so.
 ld.so: _dl_signal_error + REL R_386_GLOB_DAT
 ld.so: _dl_catch_error + REL R_386_GLOB_DAT