summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-11-30 16:23:58 +0100
committerFlorian Weimer <fweimer@redhat.com>2016-11-30 16:23:58 +0100
commitb04beebf0731c0da49bf9113bf299acf56e4c2e5 (patch)
treee9d30cedb0a14f36f23dcab98641603c2cbe92dc /elf
parent9e78f6f6e7134a5f299cc8de77370218f8019237 (diff)
downloadglibc-b04beebf0731c0da49bf9113bf299acf56e4c2e5.tar.gz
glibc-b04beebf0731c0da49bf9113bf299acf56e4c2e5.tar.xz
glibc-b04beebf0731c0da49bf9113bf299acf56e4c2e5.zip
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.
Diffstat (limited to 'elf')
-rw-r--r--elf/Versions4
-rw-r--r--elf/dl-minimal.c18
2 files changed, 9 insertions, 13 deletions
diff --git a/elf/Versions b/elf/Versions
index 05e5449f4d..08f76a7a20 100644
--- a/elf/Versions
+++ b/elf/Versions
@@ -34,8 +34,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 6034b5a3fa..116ec4978c 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.  */