Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix localplt check for GNU_IFUNC
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.
  • Loading branch information
Adhemerval Zanella committed Mar 25, 2014
1 parent 7578473 commit 7bc5a74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions 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
Expand Down
10 changes: 8 additions & 2 deletions scripts/localplt.awk
Expand Up @@ -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 }
Expand Down

0 comments on commit 7bc5a74

Please sign in to comment.