fa3bfd
commit 9637d8a253493be471d9a71640e91349f7a8a050
fa3bfd
Author: H.J. Lu <hjl.tools@gmail.com>
fa3bfd
Date:   Wed Jul 29 11:57:54 2015 -0700
fa3bfd
fa3bfd
    Extend local PLT reference check
fa3bfd
fa3bfd
    On x86, linker in binutils 2.26 and newer consolidates R_*_JUMP_SLOT with
fa3bfd
    R_*_GLOB_DAT relocation against the same symbol.  This patch extends
fa3bfd
    local PLT reference check to support alternate relocations.
fa3bfd
fa3bfd
        [BZ #18078]
fa3bfd
        * scripts/check-localplt.awk: Support alternate relocations.
fa3bfd
        * scripts/localplt.awk: Also check relocations in DT_RELA/DT_REL
fa3bfd
        sections.
fa3bfd
        * sysdeps/unix/sysv/linux/i386/localplt.data: Mark free and
fa3bfd
        malloc entries with + REL R_386_GLOB_DAT.
fa3bfd
        * sysdeps/x86_64/localplt.data: New file.
fa3bfd
fa3bfd
fa3bfd
commit da53d6dbc28d2a90d6e14dd661e68611c3b741cf
fa3bfd
Author: Carlos O'Donell <carlos@redhat.com>
fa3bfd
Date:   Thu Nov 6 15:48:44 2014 -0500
fa3bfd
fa3bfd
    Run check-localpltk/textrel/execstack over ld.so.
fa3bfd
fa3bfd
    For maximum paranoia we run ld.so through the normal set
fa3bfd
    of tests for all of the shared libraries. This includes
fa3bfd
    running ld.so through check-localplt, check-textrel, and
fa3bfd
    check-execstack. While none of these should trigger any
fa3bfd
    failures given the way ld.so is built, it might possibly
fa3bfd
    fail if a developer does something wrong. This paranoia
fa3bfd
    was triggered by a discussion over the use of __strcpy
fa3bfd
    vs. strcpy [1] and if the symbol could leak and use the
fa3bfd
    libc.so version.
fa3bfd
fa3bfd
    The check-localplt test fails right away because localplt.data
fa3bfd
    needs updating for all arches. By default we add 6 new symbols:
fa3bfd
    __tls_get_addr, __libc_memalign, malloc, calloc, realloc and
fa3bfd
    free. Other machines like i386, power, and s390 require some
fa3bfd
    different symbol sets e.g. ___tls_get_addr vs. __tls_get_addr
fa3bfd
    for i386.
fa3bfd
fa3bfd
commit d3d9c95aefded7716d037e241f9d23a1cccab45a
fa3bfd
Author: H.J. Lu <hjl.tools@gmail.com>
fa3bfd
Date:   Wed Oct 14 05:59:50 2015 -0700
fa3bfd
fa3bfd
    Support PLT and GOT references in local PIC check
fa3bfd
fa3bfd
commit a0af371c25ac1f215cf0db64e54cbb9a1b51f78c
fa3bfd
Author: Alan Modra <amodra@gmail.com>
fa3bfd
Date:   Fri Feb 20 15:23:28 2015 +1030
fa3bfd
fa3bfd
    Fix localplt test breakage with new readelf
fa3bfd
fa3bfd
    Since 2014-11-24 binutils git commit bb4d2ac2, readelf has appended
fa3bfd
    the symbol version to symbols shown in reloc dumps.
fa3bfd
fa3bfd
        [BZ #16512]
fa3bfd
        * scripts/localplt.awk: Strip off symbol version.
fa3bfd
        * NEWS: Mention bug fix.
fa3bfd
fa3bfd
diff -Nrup a/elf/Makefile b/elf/Makefile
fa3bfd
--- a/elf/Makefile	2017-10-22 09:16:02.451399056 -0400
fa3bfd
+++ b/elf/Makefile	2017-10-22 09:16:39.217285466 -0400
fa3bfd
@@ -915,7 +915,7 @@ $(objpfx)tst-pie1: $(objpfx)tst-piemod1.
fa3bfd
 ifeq (yes,$(build-shared))
fa3bfd
 tests: $(objpfx)check-textrel.out $(objpfx)check-execstack.out
fa3bfd
 
fa3bfd
-all-built-dso := $(common-objpfx)libc.so \
fa3bfd
+all-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
fa3bfd
 		 $(filter-out $(common-objpfx)linkobj/libc.so, \
fa3bfd
 			      $(sort $(wildcard $(addprefix $(common-objpfx), \
fa3bfd
 							    */lib*.so \
fa3bfd
@@ -974,6 +974,7 @@ tests: $(objpfx)check-localplt.out
fa3bfd
 
fa3bfd
 localplt-built-dso := $(addprefix $(common-objpfx),\
fa3bfd
 				  libc.so \
fa3bfd
+                                  elf/ld.so \
fa3bfd
 				  math/libm.so \
fa3bfd
 				  rt/librt.so \
fa3bfd
 				  dlfcn/libdl.so \
fa3bfd
diff -Nrup a/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data b/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data
fa3bfd
--- a/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data	2017-10-22 09:16:01.379402341 -0400
fa3bfd
+++ b/ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data	2017-10-22 09:16:39.217285466 -0400
fa3bfd
@@ -12,3 +12,15 @@ libm.so: matherr
fa3bfd
 libm.so: __signbit
fa3bfd
 libm.so: __signbitf
fa3bfd
 libm.so: __signbitl
fa3bfd
+# The dynamic loader needs __tls_get_addr for TLS.
fa3bfd
+ld.so: __tls_get_addr
fa3bfd
+# The dynamic loader uses __libc_memalign internally to allocate aligned
fa3bfd
+# TLS storage. The other malloc family of functions are expected to allow
fa3bfd
+# user symbol interposition.
fa3bfd
+ld.so: __libc_memalign + RELA R_X86_64_GLOB_DAT
fa3bfd
+# The main malloc is interposed into the dynamic linker, for
fa3bfd
+# allocations after the initial link (when dlopen is used).
fa3bfd
+ld.so: malloc
fa3bfd
+ld.so: calloc
fa3bfd
+ld.so: realloc
fa3bfd
+ld.so: free
fa3bfd
diff -Nrup a/scripts/check-localplt.awk b/scripts/check-localplt.awk
fa3bfd
--- a/scripts/check-localplt.awk	2012-12-24 22:02:13.000000000 -0500
fa3bfd
+++ b/scripts/check-localplt.awk	2017-10-22 09:16:39.218285463 -0400
fa3bfd
@@ -3,9 +3,16 @@
fa3bfd
 # Each line is either a comment starting with # or it looks like:
fa3bfd
 #	libfoo.so: function
fa3bfd
 # or
fa3bfd
+#      libfoo.so: function + {RELA|REL} RELOC
fa3bfd
+# or
fa3bfd
 #	libfoo.so: function ?
fa3bfd
 # The latter means that a PLT entry for function is optional in libfoo.so.
fa3bfd
 # The former means one is required.
fa3bfd
+# The first entry means that one is required.
fa3bfd
+# The second entry means that one is required and relocation may also be
fa3bfd
+# {RELA|REL} RELOC.
fa3bfd
+# The third entry means that a PLT entry for function is optional in
fa3bfd
+# libfoo.so.
fa3bfd
 # The second file argument is - and this (stdin) receives the output
fa3bfd
 # of the check-localplt program.
fa3bfd
 
fa3bfd
@@ -14,7 +21,10 @@ BEGIN { result = 0 }
fa3bfd
 FILENAME != "-" && /^#/ { next }
fa3bfd
 
fa3bfd
 FILENAME != "-" {
fa3bfd
-  if (NF != 2 && !(NF == 3 && $3 == "?")) {
fa3bfd
+  if (NF == 5 && $3 == "+" && ($4 == "RELA" || $4 == "REL")) {
fa3bfd
+    accept_type[$1 " " $2] = $4;
fa3bfd
+    accept_reloc[$1 " " $2] = $5;
fa3bfd
+  } else if (NF != 2 && !(NF == 3 && $3 == "?")) {
fa3bfd
     printf "%s:%d: bad data line: %s\n", FILENAME, FNR, $0 > "/dev/stderr";
fa3bfd
     result = 2;
fa3bfd
   } else {
fa3bfd
@@ -23,7 +33,7 @@ FILENAME != "-" {
fa3bfd
   next;
fa3bfd
 }
fa3bfd
 
fa3bfd
-NF != 2 {
fa3bfd
+NF != 2 && !(NF == 4 && ($3 == "RELA" || $3 == "REL")) {
fa3bfd
   print "Unexpected output from check-localplt:", $0 > "/dev/stderr";
fa3bfd
   result = 2;
fa3bfd
   next
fa3bfd
@@ -31,7 +41,23 @@ NF != 2 {
fa3bfd
 
fa3bfd
 {
fa3bfd
   key = $1 " " $2
fa3bfd
-  if (key in accept) {
fa3bfd
+  if ($3 == "RELA" || $3 == "REL") {
fa3bfd
+    # Entries like:
fa3bfd
+    # libc.so: free + RELA R_X86_64_GLOB_DAT
fa3bfd
+    # may be ignored.
fa3bfd
+    if (key in accept_type && accept_type[key] == $3 && accept_reloc[key] == $4) {
fa3bfd
+      # Match
fa3bfd
+      # libc.so: free + RELA R_X86_64_GLOB_DAT
fa3bfd
+      delete accept_type[key]
fa3bfd
+    }
fa3bfd
+  } else if (NF == 2 && key in accept_reloc) {
fa3bfd
+    # Match
fa3bfd
+    # libc.so: free
fa3bfd
+    # against
fa3bfd
+    # libc.so: free + RELA R_X86_64_GLOB_DAT
fa3bfd
+    if (key in accept_type)
fa3bfd
+      delete accept_type[key]
fa3bfd
+  } else if (key in accept) {
fa3bfd
     delete accept[key]
fa3bfd
   } else {
fa3bfd
     print "Extra PLT reference:", $0;
fa3bfd
@@ -49,5 +75,11 @@ END {
fa3bfd
     }
fa3bfd
   }
fa3bfd
 
fa3bfd
+  for (key in accept_type) {
fa3bfd
+    # It's mandatory.
fa3bfd
+    print "Missing required PLT or " accept_reloc[key] " reference:", key;
fa3bfd
+    result = 1;
fa3bfd
+  }
fa3bfd
+
fa3bfd
   exit(result);
fa3bfd
 }
fa3bfd
diff -Nrup a/scripts/localplt.awk b/scripts/localplt.awk
fa3bfd
--- a/scripts/localplt.awk	2012-12-24 22:02:13.000000000 -0500
fa3bfd
+++ b/scripts/localplt.awk	2017-10-22 09:16:39.218285463 -0400
fa3bfd
@@ -7,12 +7,14 @@
fa3bfd
 BEGIN { result = 0 }
fa3bfd
 
fa3bfd
 FILENAME != lastfile {
fa3bfd
-  if (lastfile && jmprel_offset == 0) {
fa3bfd
+  if (lastfile && jmprel_offset == 0 && rela_offset == 0 && rel_offset == 0) {
fa3bfd
     print FILENAME ": *** failed to find expected output (readelf -WSdr)";
fa3bfd
     result = 2;
fa3bfd
   }
fa3bfd
   lastfile = FILENAME;
fa3bfd
   jmprel_offset = 0;
fa3bfd
+  rela_offset = 0;
fa3bfd
+  rel_offset = 0;
fa3bfd
   delete section_offset_by_address;
fa3bfd
 }
fa3bfd
 
fa3bfd
@@ -32,9 +34,39 @@ $1 == "Offset" && $2 == "Info" { in_relo
fa3bfd
 NF == 0 { in_relocs = 0 }
fa3bfd
 
fa3bfd
 in_relocs && relocs_offset == jmprel_offset && NF >= 5 {
fa3bfd
-  symval = strtonum("0x" $4);
fa3bfd
-  if (symval != 0)
fa3bfd
-    print whatfile, $5
fa3bfd
+  # Relocations against GNU_IFUNC symbols are not shown as an hexadecimal
fa3bfd
+  # value, but rather as the resolver symbol followed by ().
fa3bfd
+  if ($4 ~ /\(\)/) {
fa3bfd
+    print whatfile, gensub(/@.*/, "", "g", $5)
fa3bfd
+  } else {
fa3bfd
+    symval = strtonum("0x" $4);
fa3bfd
+    if (symval != 0)
fa3bfd
+      print whatfile, gensub(/@.*/, "", "g", $5)
fa3bfd
+  }
fa3bfd
+}
fa3bfd
+
fa3bfd
+in_relocs && relocs_offset == rela_offset && NF >= 5 {
fa3bfd
+  # Relocations against GNU_IFUNC symbols are not shown as an hexadecimal
fa3bfd
+  # value, but rather as the resolver symbol followed by ().
fa3bfd
+  if ($4 ~ /\(\)/) {
fa3bfd
+    print whatfile, gensub(/@.*/, "", "g", $5), "RELA", $3
fa3bfd
+  } else {
fa3bfd
+    symval = strtonum("0x" $4);
fa3bfd
+    if (symval != 0)
fa3bfd
+      print whatfile, gensub(/@.*/, "", "g", $5), "RELA", $3
fa3bfd
+  }
fa3bfd
+}
fa3bfd
+
fa3bfd
+in_relocs && relocs_offset == rel_offset && NF >= 5 {
fa3bfd
+  # Relocations against GNU_IFUNC symbols are not shown as an hexadecimal
fa3bfd
+  # value, but rather as the resolver symbol followed by ().
fa3bfd
+  if ($4 ~ /\(\)/) {
fa3bfd
+    print whatfile, gensub(/@.*/, "", "g", $5), "REL", $3
fa3bfd
+  } else {
fa3bfd
+    symval = strtonum("0x" $4);
fa3bfd
+    if (symval != 0)
fa3bfd
+      print whatfile, gensub(/@.*/, "", "g", $5), "REL", $3
fa3bfd
+  }
fa3bfd
 }
fa3bfd
 
fa3bfd
 in_relocs { next }
fa3bfd
@@ -56,4 +88,25 @@ $2 == "(JMPREL)" {
fa3bfd
   next
fa3bfd
 }
fa3bfd
 
fa3bfd
+$2 == "(RELA)" {
fa3bfd
+  rela_addr = strtonum($3);
fa3bfd
+  if (rela_addr in section_offset_by_address) {
fa3bfd
+    rela_offset = section_offset_by_address[rela_addr];
fa3bfd
+  } else {
fa3bfd
+    print FILENAME ": *** DT_RELA does not match any section's address";
fa3bfd
+    result = 2;
fa3bfd
+  }
fa3bfd
+  next
fa3bfd
+}
fa3bfd
+
fa3bfd
+$2 == "(REL)" {
fa3bfd
+  rel_addr = strtonum($3);
fa3bfd
+  if (rel_addr in section_offset_by_address) {
fa3bfd
+    rel_offset = section_offset_by_address[rel_addr];
fa3bfd
+  } else {
fa3bfd
+    print FILENAME ": *** DT_REL does not match any section's address";
fa3bfd
+    result = 2;
fa3bfd
+  }
fa3bfd
+  next
fa3bfd
+}
fa3bfd
 END { exit(result) }
fa3bfd
diff -Nrup a/sysdeps/generic/localplt.data b/sysdeps/generic/localplt.data
fa3bfd
--- a/sysdeps/generic/localplt.data	2012-12-24 22:02:13.000000000 -0500
fa3bfd
+++ b/sysdeps/generic/localplt.data	2017-10-22 09:18:03.383023954 -0400
fa3bfd
@@ -7,3 +7,9 @@ libc.so: malloc
fa3bfd
 libc.so: memalign
fa3bfd
 libc.so: realloc
fa3bfd
 libm.so: matherr
fa3bfd
+# The main malloc is interposed into the dynamic linker, for
fa3bfd
+# allocations after the initial link (when dlopen is used).
fa3bfd
+ld.so: malloc
fa3bfd
+ld.so: calloc
fa3bfd
+ld.so: realloc
fa3bfd
+ld.so: free
fa3bfd
diff -Nrup a/sysdeps/unix/sysv/linux/i386/nptl/localplt.data b/sysdeps/unix/sysv/linux/i386/nptl/localplt.data
fa3bfd
--- a/sysdeps/unix/sysv/linux/i386/nptl/localplt.data	2012-12-24 22:02:13.000000000 -0500
fa3bfd
+++ b/sysdeps/unix/sysv/linux/i386/nptl/localplt.data	2017-10-22 09:16:39.218285463 -0400
fa3bfd
@@ -1,7 +1,21 @@
fa3bfd
-libc.so: _Unwind_Find_FDE
fa3bfd
-libc.so: calloc
fa3bfd
-libc.so: free
fa3bfd
-libc.so: malloc
fa3bfd
-libc.so: memalign
fa3bfd
-libc.so: realloc
fa3bfd
-libm.so: matherr
fa3bfd
+# Linker in binutils 2.26 and newer consolidates R_X86_64_JUMP_SLOT
fa3bfd
+# relocation with R_386_GLOB_DAT relocation against the same symbol.
fa3bfd
+libc.so: _Unwind_Find_FDE + REL R_386_GLOB_DAT
fa3bfd
+libc.so: calloc + REL R_386_GLOB_DAT
fa3bfd
+libc.so: free + REL R_386_GLOB_DAT
fa3bfd
+libc.so: malloc + REL R_386_GLOB_DAT
fa3bfd
+libc.so: memalign + REL R_386_GLOB_DAT
fa3bfd
+libc.so: realloc + REL R_386_GLOB_DAT
fa3bfd
+libm.so: matherr + REL R_386_GLOB_DAT
fa3bfd
+# The dynamic loader uses __libc_memalign internally to allocate aligned
fa3bfd
+# TLS storage. The other malloc family of functions are expected to allow
fa3bfd
+# user symbol interposition.
fa3bfd
+ld.so: __libc_memalign + REL R_386_GLOB_DAT
fa3bfd
+# The dynamic loader needs __tls_get_addr for TLS.
fa3bfd
+ld.so: ___tls_get_addr + REL R_386_GLOB_DAT
fa3bfd
+# The main malloc is interposed into the dynamic linker, for
fa3bfd
+# allocations after the initial link (when dlopen is used).
fa3bfd
+ld.so: malloc + REL R_386_GLOB_DAT
fa3bfd
+ld.so: calloc + REL R_386_GLOB_DAT
fa3bfd
+ld.so: realloc + REL R_386_GLOB_DAT
fa3bfd
+ld.so: free + REL R_386_GLOB_DAT
fa3bfd
diff -Nrup a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/localplt.data
fa3bfd
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/localplt.data	2012-12-24 22:02:13.000000000 -0500
fa3bfd
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/localplt.data	2017-10-22 09:16:39.218285463 -0400
fa3bfd
@@ -5,3 +5,13 @@ libc.so: malloc
fa3bfd
 libc.so: memalign
fa3bfd
 libc.so: realloc
fa3bfd
 libm.so: matherr
fa3bfd
+# The dynamic loader uses __libc_memalign internally to allocate aligned
fa3bfd
+# TLS storage. The other malloc family of functions are expected to allow
fa3bfd
+# user symbol interposition.
fa3bfd
+ld.so: __libc_memalign
fa3bfd
+# The main malloc is interposed into the dynamic linker, for
fa3bfd
+# allocations after the initial link (when dlopen is used).
fa3bfd
+ld.so: malloc
fa3bfd
+ld.so: calloc
fa3bfd
+ld.so: realloc
fa3bfd
+ld.so: free
fa3bfd
diff -Nrup a/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/localplt.data b/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/localplt.data
fa3bfd
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/localplt.data	2012-12-24 22:02:13.000000000 -0500
fa3bfd
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/localplt.data	2017-10-22 09:16:39.218285463 -0400
fa3bfd
@@ -4,3 +4,13 @@ libc.so: malloc
fa3bfd
 libc.so: memalign
fa3bfd
 libc.so: realloc
fa3bfd
 libm.so: matherr
fa3bfd
+# The dynamic loader uses __libc_memalign internally to allocate aligned
fa3bfd
+# TLS storage. The other malloc family of functions are expected to allow
fa3bfd
+# user symbol interposition.
fa3bfd
+ld.so: __libc_memalign
fa3bfd
+# The main malloc is interposed into the dynamic linker, for
fa3bfd
+# allocations after the initial link (when dlopen is used).
fa3bfd
+ld.so: malloc
fa3bfd
+ld.so: calloc
fa3bfd
+ld.so: realloc
fa3bfd
+ld.so: free
fa3bfd
diff -Nrup a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/localplt.data b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/localplt.data
fa3bfd
--- a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/localplt.data	2012-12-24 22:02:13.000000000 -0500
fa3bfd
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/localplt.data	2017-10-22 09:16:39.219285460 -0400
fa3bfd
@@ -5,3 +5,13 @@ libc.so: malloc
fa3bfd
 libc.so: memalign
fa3bfd
 libc.so: realloc
fa3bfd
 libm.so: matherr
fa3bfd
+# The dynamic loader uses __libc_memalign internally to allocate aligned
fa3bfd
+# TLS storage. The other malloc family of functions are expected to allow
fa3bfd
+# user symbol interposition.
fa3bfd
+ld.so: __libc_memalign
fa3bfd
+# The main malloc is interposed into the dynamic linker, for
fa3bfd
+# allocations after the initial link (when dlopen is used).
fa3bfd
+ld.so: malloc
fa3bfd
+ld.so: calloc
fa3bfd
+ld.so: realloc
fa3bfd
+ld.so: free
fa3bfd
diff -Nrup a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/localplt.data b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/localplt.data
fa3bfd
--- a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/localplt.data	2012-12-24 22:02:13.000000000 -0500
fa3bfd
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/localplt.data	2017-10-22 09:16:39.219285460 -0400
fa3bfd
@@ -5,3 +5,13 @@ libc.so: malloc
fa3bfd
 libc.so: memalign
fa3bfd
 libc.so: realloc
fa3bfd
 libm.so: matherr
fa3bfd
+# The dynamic loader uses __libc_memalign internally to allocate aligned
fa3bfd
+# TLS storage. The other malloc family of functions are expected to allow
fa3bfd
+# user symbol interposition.
fa3bfd
+ld.so: __libc_memalign
fa3bfd
+# The main malloc is interposed into the dynamic linker, for
fa3bfd
+# allocations after the initial link (when dlopen is used).
fa3bfd
+ld.so: malloc
fa3bfd
+ld.so: calloc
fa3bfd
+ld.so: realloc
fa3bfd
+ld.so: free
fa3bfd
diff -Nrup a/sysdeps/x86_64/nptl/localplt.data b/sysdeps/x86_64/nptl/localplt.data
fa3bfd
--- a/sysdeps/x86_64/nptl/localplt.data	1969-12-31 19:00:00.000000000 -0500
fa3bfd
+++ b/sysdeps/x86_64/nptl/localplt.data	2017-10-22 09:16:39.219285460 -0400
fa3bfd
@@ -0,0 +1,23 @@
fa3bfd
+# See scripts/check-localplt.awk for how this file is processed.
fa3bfd
+# PLT use is required for the malloc family and for matherr because
fa3bfd
+# users can define their own functions and have library internals call them.
fa3bfd
+# Linker in binutils 2.26 and newer consolidates R_X86_64_JUMP_SLOT
fa3bfd
+# relocation with R_X86_64_GLOB_DAT relocation against the same symbol.
fa3bfd
+libc.so: calloc + RELA R_X86_64_GLOB_DAT
fa3bfd
+libc.so: free + RELA R_X86_64_GLOB_DAT
fa3bfd
+libc.so: malloc + RELA R_X86_64_GLOB_DAT
fa3bfd
+libc.so: memalign + RELA R_X86_64_GLOB_DAT
fa3bfd
+libc.so: realloc + RELA R_X86_64_GLOB_DAT
fa3bfd
+libm.so: matherr + RELA R_X86_64_GLOB_DAT
fa3bfd
+# The dynamic loader uses __libc_memalign internally to allocate aligned
fa3bfd
+# TLS storage. The other malloc family of functions are expected to allow
fa3bfd
+# user symbol interposition.
fa3bfd
+ld.so: __libc_memalign + RELA R_X86_64_GLOB_DAT
fa3bfd
+# The dynamic loader needs __tls_get_addr for TLS.
fa3bfd
+ld.so: __tls_get_addr + RELA R_X86_64_GLOB_DAT
fa3bfd
+# The main malloc is interposed into the dynamic linker, for
fa3bfd
+# allocations after the initial link (when dlopen is used).
fa3bfd
+ld.so: malloc + RELA R_X86_64_GLOB_DAT
fa3bfd
+ld.so: calloc + RELA R_X86_64_GLOB_DAT
fa3bfd
+ld.so: realloc + RELA R_X86_64_GLOB_DAT
fa3bfd
+ld.so: free + RELA R_X86_64_GLOB_DAT