]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix localplt check for GNU_IFUNC
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Wed, 19 Mar 2014 20:30:18 +0000 (15:30 -0500)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Tue, 25 Mar 2014 19:15:35 +0000 (14:15 -0500)
GNU_IFUNC are shown by readelf in 'Relocation section' value as
"symbol()" instead of expected hexadecimal value. This causes the
check-localplt script to ignore potential PLT stub begin generated
by wrong IFUNC usage.  This patch changes the localplt script to
emit such PLT cases.

ChangeLog
scripts/localplt.awk

index e828cc28a57291d373d8b05a93da922661655fa6..a4aab107c0f06c4bac37c819222662d5ad96fa52 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-25 Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+       * scripts/localplt.awk: Check for PLT generated by internal IFUNC
+       calls.
+
 2014-03-25 Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
        * nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Revert
index 2265b026f0793f9ea756eb6eadb9b99e17417b36..f55c41a03739a96c4f0d372fb3baadcffe9df012 100644 (file)
@@ -32,9 +32,15 @@ $1 == "Offset" && $2 == "Info" { in_relocs = 1; next }
 NF == 0 { in_relocs = 0 }
 
 in_relocs && relocs_offset == jmprel_offset && NF >= 5 {
-  symval = strtonum("0x" $4);
-  if (symval != 0)
+  # Relocations against GNU_IFUNC symbols are not shown as an hexadecimal
+  # value, but rather as the resolver symbol followed by ().
+  if ($4 ~ /\(\)/) {
     print whatfile, $5
+  } else {
+    symval = strtonum("0x" $4);
+    if (symval != 0)
+      print whatfile, $5
+  }
 }
 
 in_relocs { next }