diff mbox

ld.so __libc_memalign cleanup

Message ID e8f18477-3ded-f509-7365-b188bb8a96e1@redhat.com
State Accepted
Commit b04beebf0731c0da49bf9113bf299acf56e4c2e5
Headers show

Commit Message

Florian Weimer Nov. 16, 2016, 2:59 p.m. UTC
I did not understand what was going on in terms of exported symbols when 
I removed the use of __libc_memalign from ld.so.  Andreas explained to 
me that the libc malloc is interposed into the dynamic linker (for later 
use during dlopen), and that's the reason why the symbols are public in 
ld.so.

Now that we no longer use __libc_memalign, we do not need to interpose 
it, so the attached patch removes it from ld.so.

Tested on s390x, ppc64le, x86_64, i386, s390, ppc, aarch64.  (Final 
version with the elf/Versions change only tested on x86_64, ppc, aarch64.)

Thanks,
Florian

Comments

Florian Weimer Nov. 30, 2016, 3:43 p.m. UTC | #1
On 11/16/2016 03:59 PM, Florian Weimer wrote:
> I did not understand what was going on in terms of exported symbols when

> I removed the use of __libc_memalign from ld.so.  Andreas explained to

> me that the libc malloc is interposed into the dynamic linker (for later

> use during dlopen), and that's the reason why the symbols are public in

> ld.so.

>

> Now that we no longer use __libc_memalign, we do not need to interpose

> it, so the attached patch removes it from ld.so.

>

> Tested on s390x, ppc64le, x86_64, i386, s390, ppc, aarch64.  (Final

> version with the elf/Versions change only tested on x86_64, ppc, aarch64.)


I have committed this.

Thanks,
Florian
diff mbox

Patch

ld.so: Remove __libc_memalign

It is no longer needed since commit 6c444ad6e953dbdf9c7be065308a0a777
(elf: Do not use memalign for TCB/TLS blocks allocation [BZ #17730]).
Applications do not link against ld.so and will use the definition in
libc.so, so there is no ABI impact.

2016-11-16  Florian Weimer  <fweimer@redhat.com>

	Remove __libc_memalign from ld.so because it is unused.
	* elf/dl-minimal.c: Update comment on the malloc implementation.
	(malloc): Renamed from __libc_memalign, replacing the original
	malloc implementation.  Replace the align parameter with
	MALLOC_ALIGNMENT.
	* elf/Versions (ld): Update comment and remove __libc_memalign.
	* sysdeps/nacl/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist: Likewise.
	* sysdeps/generic/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/alpha/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/arm/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/hppa/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/i386/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/ia64/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/m68k/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/nios2/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data
	(ld.so): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
	(ld.so): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data (ld.so):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/sh/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data (ld.so): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data (ld.so): Likewise.
	* sysdeps/x86_64/localplt.data (ld.so): Likewise.

diff --git a/elf/Versions b/elf/Versions
index 23deda9..47382e9 100644
--- a/elf/Versions
+++ b/elf/Versions
@@ -31,8 +31,8 @@  libc {
 
 ld {
   GLIBC_2.0 {
-    # Function from libc.so which must be shared with libc.
-    __libc_memalign; calloc; free; malloc; realloc;
+    # Functions which are interposed from libc.so.
+    calloc; free; malloc; realloc;
 
     _r_debug;
   }
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index 6034b5a..116ec49 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -31,8 +31,10 @@ 
 
 #include <assert.h>
 
-/* Minimal `malloc' allocator for use while loading shared libraries.
-   No block is ever freed.  */
+/* Minimal malloc allocator for used during initial link.  After the
+   initial link, a full malloc implementation is interposed, either
+   the one in libc, or a different one supplied by the user through
+   interposition.  */
 
 static void *alloc_ptr, *alloc_end, *alloc_last_block;
 
@@ -49,7 +51,7 @@  extern unsigned long int weak_function strtoul (const char *nptr,
 
 /* Allocate an aligned memory block.  */
 void * weak_function
-__libc_memalign (size_t align, size_t n)
+malloc (size_t n)
 {
   if (alloc_end == 0)
     {
@@ -62,8 +64,8 @@  __libc_memalign (size_t align, size_t n)
     }
 
   /* Make sure the allocation pointer is ideally aligned.  */
-  alloc_ptr = (void *) 0 + (((alloc_ptr - (void *) 0) + align - 1)
-			    & ~(align - 1));
+  alloc_ptr = (void *) 0 + (((alloc_ptr - (void *) 0) + MALLOC_ALIGNMENT - 1)
+			    & ~(MALLOC_ALIGNMENT - 1));
 
   if (alloc_ptr + n >= alloc_end || n >= -(uintptr_t) alloc_ptr)
     {
@@ -88,12 +90,6 @@  __libc_memalign (size_t align, size_t n)
   return alloc_last_block;
 }
 
-void * weak_function
-malloc (size_t n)
-{
-  return __libc_memalign (MALLOC_ALIGNMENT, n);
-}
-
 /* We use this function occasionally since the real implementation may
    be optimized when it can assume the memory it returns already is
    set to NUL.  */
diff --git a/sysdeps/generic/localplt.data b/sysdeps/generic/localplt.data
index 1a40cf9..b3da571 100644
--- a/sysdeps/generic/localplt.data
+++ b/sysdeps/generic/localplt.data
@@ -7,10 +7,8 @@  libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/nacl/ld.abilist b/sysdeps/nacl/ld.abilist
index 242f6d0..0a52a24 100644
--- a/sysdeps/nacl/ld.abilist
+++ b/sysdeps/nacl/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.22 GLIBC_2.22 A
-GLIBC_2.22 __libc_memalign F
 GLIBC_2.22 __libc_stack_end D 0x4
 GLIBC_2.22 __stack_chk_guard D 0x4
 GLIBC_2.22 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/aarch64/ld.abilist b/sysdeps/unix/sysv/linux/aarch64/ld.abilist
index ab08a98..ec7f617 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.17 GLIBC_2.17 A
-GLIBC_2.17 __libc_memalign F
 GLIBC_2.17 __libc_stack_end D 0x8
 GLIBC_2.17 __stack_chk_guard D 0x8
 GLIBC_2.17 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/aarch64/localplt.data b/sysdeps/unix/sysv/linux/aarch64/localplt.data
index d7d6734..e262471 100644
--- a/sysdeps/unix/sysv/linux/aarch64/localplt.data
+++ b/sysdeps/unix/sysv/linux/aarch64/localplt.data
@@ -7,11 +7,10 @@  libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
+# The dynamic loader needs __tls_get_addr for TLS.
 ld.so: __tls_get_addr
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/alpha/ld.abilist b/sysdeps/unix/sysv/linux/alpha/ld.abilist
index 9faf6eb..ca34294 100644
--- a/sysdeps/unix/sysv/linux/alpha/ld.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
 GLIBC_2.0 _r_debug D 0x28
 GLIBC_2.0 calloc F
 GLIBC_2.0 free F
diff --git a/sysdeps/unix/sysv/linux/alpha/localplt.data b/sysdeps/unix/sysv/linux/alpha/localplt.data
index 351596c..061e9a9 100644
--- a/sysdeps/unix/sysv/linux/alpha/localplt.data
+++ b/sysdeps/unix/sysv/linux/alpha/localplt.data
@@ -24,11 +24,10 @@  libm.so: matherr
 # We used to offer inline functions that used this, so it must be exported.
 # Ought to reorg things such that carg isn't thus forced to use a plt.
 libm.so: __atan2
-# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
+# The dynamic loader needs __tls_get_addr for TLS.
 ld.so: __tls_get_addr ?
-ld.so: __libc_memalign + RELA R_ALPHA_GLOB_DAT
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc + RELA R_ALPHA_GLOB_DAT
 ld.so: calloc + RELA R_ALPHA_GLOB_DAT
 ld.so: realloc + RELA R_ALPHA_GLOB_DAT
diff --git a/sysdeps/unix/sysv/linux/arm/ld.abilist b/sysdeps/unix/sysv/linux/arm/ld.abilist
index 4de351e..cbf3a3c 100644
--- a/sysdeps/unix/sysv/linux/arm/ld.abilist
+++ b/sysdeps/unix/sysv/linux/arm/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.4 GLIBC_2.4 A
-GLIBC_2.4 __libc_memalign F
 GLIBC_2.4 __libc_stack_end D 0x4
 GLIBC_2.4 __stack_chk_guard D 0x4
 GLIBC_2.4 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/arm/localplt.data b/sysdeps/unix/sysv/linux/arm/localplt.data
index 4301703..cad7e04 100644
--- a/sysdeps/unix/sysv/linux/arm/localplt.data
+++ b/sysdeps/unix/sysv/linux/arm/localplt.data
@@ -7,11 +7,10 @@  libc.so: realloc
 libm.so: matherr
 libpthread.so: __errno_location
 libpthread.so: raise
-# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
+# The dynamic loader needs __tls_get_addr for TLS.
 ld.so: __tls_get_addr
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/hppa/ld.abilist b/sysdeps/unix/sysv/linux/hppa/ld.abilist
index dc3ebf4..fc1c60e 100644
--- a/sysdeps/unix/sysv/linux/hppa/ld.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
 GLIBC_2.2 __libc_stack_end D 0x4
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x14
diff --git a/sysdeps/unix/sysv/linux/hppa/localplt.data b/sysdeps/unix/sysv/linux/hppa/localplt.data
index 2a25ebc..212354c 100644
--- a/sysdeps/unix/sysv/linux/hppa/localplt.data
+++ b/sysdeps/unix/sysv/linux/hppa/localplt.data
@@ -13,10 +13,8 @@  libc.so: sigprocmask
 libc.so: __errno_location
 libm.so: matherr
 libpthread.so: __errno_location
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/i386/ld.abilist b/sysdeps/unix/sysv/linux/i386/ld.abilist
index b8914ed..ddf9e78 100644
--- a/sysdeps/unix/sysv/linux/i386/ld.abilist
+++ b/sysdeps/unix/sysv/linux/i386/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
 GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.0 calloc F
 GLIBC_2.0 free F
diff --git a/sysdeps/unix/sysv/linux/i386/localplt.data b/sysdeps/unix/sysv/linux/i386/localplt.data
index 4ce8447..7bcdec0 100644
--- a/sysdeps/unix/sysv/linux/i386/localplt.data
+++ b/sysdeps/unix/sysv/linux/i386/localplt.data
@@ -7,10 +7,8 @@  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
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign + 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
diff --git a/sysdeps/unix/sysv/linux/ia64/ld.abilist b/sysdeps/unix/sysv/linux/ia64/ld.abilist
index 9041ccb..9b45d5e 100644
--- a/sysdeps/unix/sysv/linux/ia64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
 GLIBC_2.2 __libc_stack_end D 0x8
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x28
diff --git a/sysdeps/unix/sysv/linux/ia64/localplt.data b/sysdeps/unix/sysv/linux/ia64/localplt.data
index b628ca4..11dbcd8 100644
--- a/sysdeps/unix/sysv/linux/ia64/localplt.data
+++ b/sysdeps/unix/sysv/linux/ia64/localplt.data
@@ -6,10 +6,8 @@  libc.so: realloc
 libm.so: matherr
 libm.so: matherrf
 libm.so: matherrl
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
index 4de351e..cbf3a3c 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.4 GLIBC_2.4 A
-GLIBC_2.4 __libc_memalign F
 GLIBC_2.4 __libc_stack_end D 0x4
 GLIBC_2.4 __stack_chk_guard D 0x4
 GLIBC_2.4 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/m68k/localplt.data b/sysdeps/unix/sysv/linux/m68k/localplt.data
index 88124c4..f031350 100644
--- a/sysdeps/unix/sysv/linux/m68k/localplt.data
+++ b/sysdeps/unix/sysv/linux/m68k/localplt.data
@@ -6,10 +6,8 @@  libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
index ee34589..3907c9d 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
 GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.0 calloc F
 GLIBC_2.0 free F
diff --git a/sysdeps/unix/sysv/linux/microblaze/ld.abilist b/sysdeps/unix/sysv/linux/microblaze/ld.abilist
index f486acb..265085e 100644
--- a/sysdeps/unix/sysv/linux/microblaze/ld.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.18 GLIBC_2.18 A
-GLIBC_2.18 __libc_memalign F
 GLIBC_2.18 __libc_stack_end D 0x4
 GLIBC_2.18 __stack_chk_guard D 0x4
 GLIBC_2.18 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/microblaze/localplt.data b/sysdeps/unix/sysv/linux/microblaze/localplt.data
index 176d618..0ace2e2 100644
--- a/sysdeps/unix/sysv/linux/microblaze/localplt.data
+++ b/sysdeps/unix/sysv/linux/microblaze/localplt.data
@@ -6,11 +6,10 @@  libc.so: memalign
 libc.so: realloc
 libm.so: matherr
 libpthread.so: __errno_location
-# The dynamic loader needs __tls_get_addr for TLS, and uses __libc_memalign
-# internally to allocate aligned TLS storage. The other malloc family of
-# functions are expected to allow user symbol interposition.
+# The dynamic loader needs __tls_get_addr for TLS.
 ld.so: __tls_get_addr
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
index afdb905..651b952 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
 GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.0 calloc F
 GLIBC_2.0 free F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
index 6993e70..bf55148 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
 GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.0 calloc F
 GLIBC_2.0 free F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
index 759e99b..f7ba5fd 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
 GLIBC_2.0 _r_debug D 0x28
 GLIBC_2.0 calloc F
 GLIBC_2.0 free F
diff --git a/sysdeps/unix/sysv/linux/nios2/ld.abilist b/sysdeps/unix/sysv/linux/nios2/ld.abilist
index 389bdaa..a127464 100644
--- a/sysdeps/unix/sysv/linux/nios2/ld.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.21 GLIBC_2.21 A
-GLIBC_2.21 __libc_memalign F
 GLIBC_2.21 __libc_stack_end D 0x4
 GLIBC_2.21 __stack_chk_guard D 0x4
 GLIBC_2.21 __tls_get_addr F
diff --git a/sysdeps/unix/sysv/linux/nios2/localplt.data b/sysdeps/unix/sysv/linux/nios2/localplt.data
index 6cf93cc..fd266ae 100644
--- a/sysdeps/unix/sysv/linux/nios2/localplt.data
+++ b/sysdeps/unix/sysv/linux/nios2/localplt.data
@@ -27,10 +27,8 @@  libc.so: __nedf2
 libc.so: __eqdf2
 libc.so: __extendsfdf2
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data
index b25abf8..c8cd5e7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/localplt.data
@@ -5,10 +5,8 @@  libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
index 2eb4d5f..100d133 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
 GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.0 calloc F
 GLIBC_2.0 free F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
index 8c4e65d..83abcb8 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
@@ -35,10 +35,8 @@  libc.so: realloc
 libm.so: copysignl ?
 libm.so: fabsl
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist
index 27d451b..ef6159b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.17 GLIBC_2.17 A
-GLIBC_2.17 __libc_memalign F
 GLIBC_2.17 __libc_stack_end D 0x8
 GLIBC_2.17 __tls_get_addr F
 GLIBC_2.17 _dl_mcount F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist
index 8914eb0..2c3b74c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist
@@ -3,7 +3,6 @@  GLIBC_2.22 __tls_get_addr_opt F
 GLIBC_2.23 GLIBC_2.23 A
 GLIBC_2.23 __parse_hwcap_and_convert_at_platform F
 GLIBC_2.3 GLIBC_2.3 A
-GLIBC_2.3 __libc_memalign F
 GLIBC_2.3 __libc_stack_end D 0x8
 GLIBC_2.3 __tls_get_addr F
 GLIBC_2.3 _dl_mcount F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data
index 49d5de6..9f31e19 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/localplt.data
@@ -4,10 +4,8 @@  libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to
-# allow user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/s390/localplt.data b/sysdeps/unix/sysv/linux/s390/localplt.data
index 1226413..c8cd5e7 100644
--- a/sysdeps/unix/sysv/linux/s390/localplt.data
+++ b/sysdeps/unix/sysv/linux/s390/localplt.data
@@ -5,17 +5,8 @@  libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-# It is also allowed to call __libc_memalign via function-pointer loaded from
-# GOT instead of calling via a plt-stub. In this case there is a R_390_GLOB_DAT
-# relocation in section .rela.dyn instead of R_390_JMP_SLOT in .rela.plt.
-# After commit "elf: Do not use memalign for TCB/TLS blocks allocation
-# [BZ #17730]" __libc_memalign is only called in elf/dl-minimal.c: malloc() in
-# ld.so and gcc -O2/-O3 leads to R_390_GLOB_DAT. If build with
-# -fno-optimize-sibling-calls an R_390_JMP_SLOT is generated.
-ld.so: __libc_memalign + RELA R_390_GLOB_DAT
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
index ec7491f..c16b2c1 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
 GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.0 calloc F
 GLIBC_2.0 free F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
index c2e0d96..5e604f5 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
 GLIBC_2.2 __libc_stack_end D 0x8
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x28
diff --git a/sysdeps/unix/sysv/linux/sh/ld.abilist b/sysdeps/unix/sysv/linux/sh/ld.abilist
index dc3ebf4..fc1c60e 100644
--- a/sysdeps/unix/sysv/linux/sh/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sh/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
 GLIBC_2.2 __libc_stack_end D 0x4
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x14
diff --git a/sysdeps/unix/sysv/linux/sh/localplt.data b/sysdeps/unix/sysv/linux/sh/localplt.data
index 57f31c5..b7631fb 100644
--- a/sysdeps/unix/sysv/linux/sh/localplt.data
+++ b/sysdeps/unix/sysv/linux/sh/localplt.data
@@ -10,10 +10,8 @@  libc.so: _Unwind_Find_FDE
 libc.so: _exit
 libc.so: __errno_location
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
index 3acaae2..fb4bcb0 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.0 GLIBC_2.0 A
-GLIBC_2.0 __libc_memalign F
 GLIBC_2.0 _r_debug D 0x14
 GLIBC_2.0 calloc F
 GLIBC_2.0 free F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data b/sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data
index a208adf..88dbab0 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data
@@ -16,10 +16,8 @@  libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate
-# aligned TLS storage. The other malloc family of functions are
-# expected to allow user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
index 9041ccb..9b45d5e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.2 GLIBC_2.2 A
-GLIBC_2.2 __libc_memalign F
 GLIBC_2.2 __libc_stack_end D 0x8
 GLIBC_2.2 _dl_mcount F
 GLIBC_2.2 _r_debug D 0x28
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data b/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data
index 2323551..e964af7 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data
@@ -18,10 +18,8 @@  libc.so: malloc
 libc.so: memalign
 libc.so: realloc
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate
-# aligned TLS storage. The other malloc family of functions are
-# expected to allow user symbol interposition.
-ld.so: __libc_memalign
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc
 ld.so: calloc
 ld.so: realloc
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/ld.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/ld.abilist
index 3ab170c..f166310 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __libc_memalign F
 GLIBC_2.12 __libc_stack_end D 0x4
 GLIBC_2.12 __tls_get_addr F
 GLIBC_2.12 _dl_mcount F
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/ld.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/ld.abilist
index aa6cbab..ab74e7e 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __libc_memalign F
 GLIBC_2.12 __libc_stack_end D 0x8
 GLIBC_2.12 __tls_get_addr F
 GLIBC_2.12 _dl_mcount F
diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/ld.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/ld.abilist
index 3ab170c..f166310 100644
--- a/sysdeps/unix/sysv/linux/tile/tilepro/ld.abilist
+++ b/sysdeps/unix/sysv/linux/tile/tilepro/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.12 GLIBC_2.12 A
-GLIBC_2.12 __libc_memalign F
 GLIBC_2.12 __libc_stack_end D 0x4
 GLIBC_2.12 __tls_get_addr F
 GLIBC_2.12 _dl_mcount F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
index 9e09ac6..07cab4b 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.2.5 GLIBC_2.2.5 A
-GLIBC_2.2.5 __libc_memalign F
 GLIBC_2.2.5 __libc_stack_end D 0x8
 GLIBC_2.2.5 _dl_mcount F
 GLIBC_2.2.5 _r_debug D 0x28
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
index d595038..236357b 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist
@@ -1,5 +1,4 @@ 
 GLIBC_2.16 GLIBC_2.16 A
-GLIBC_2.16 __libc_memalign F
 GLIBC_2.16 __libc_stack_end D 0x4
 GLIBC_2.16 __tls_get_addr F
 GLIBC_2.16 _dl_mcount F
diff --git a/sysdeps/x86_64/localplt.data b/sysdeps/x86_64/localplt.data
index f168b14..c6fe74e 100644
--- a/sysdeps/x86_64/localplt.data
+++ b/sysdeps/x86_64/localplt.data
@@ -9,10 +9,8 @@  libc.so: malloc + RELA R_X86_64_GLOB_DAT
 libc.so: memalign + RELA R_X86_64_GLOB_DAT
 libc.so: realloc + RELA R_X86_64_GLOB_DAT
 libm.so: matherr
-# The dynamic loader uses __libc_memalign internally to allocate aligned
-# TLS storage. The other malloc family of functions are expected to allow
-# user symbol interposition.
-ld.so: __libc_memalign + RELA R_X86_64_GLOB_DAT
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
 ld.so: malloc + RELA R_X86_64_GLOB_DAT
 ld.so: calloc + RELA R_X86_64_GLOB_DAT
 ld.so: realloc + RELA R_X86_64_GLOB_DAT