summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2016-10-07 15:45:47 +0200
committerPanu Matilainen <pmatilai@redhat.com>2016-10-20 15:32:36 +0300
commit881b71b550bf15c1ed09491b06b3df95c26c30ed (patch)
tree01f169543c6d034a01fa6946d54b01aba2ec41f5
parent97253efe21ea65f070b25293ac68c79cbd7ad409 (diff)
downloadrpm-881b71b550bf15c1ed09491b06b3df95c26c30ed.tar.gz
Fix mini-symtab in find-debuginfo.sh for arches with function descriptors.
add_minidebug uses nm to select the function symbols to include in the mini-symtab table. But on arches that use function descriptors (like ppc64) nm --format-posix doesn't make it clear which symbols are real functions The symbols point to the (stripped away) function descriptor table). Use --format=sysv style to match the ELF symbol type directly instead of using the somewhat ambiguous symbol type char used in --format=posix style in binutils nm. https://bugzilla.redhat.com/show_bug.cgi?id=1052415 Signed-off-by: Mark Wielaard <mjw@redhat.com> (cherry picked from commit 3f9b7bc64e8c8f2d355ce24cf67c69f507e07d5e)
-rw-r--r--scripts/find-debuginfo.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 4db0146d0..2dc1b2594 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -150,7 +150,10 @@ add_minidebug()
# in the normal symbol table
nm -D "$binary" --format=posix --defined-only | awk '{ print $1 }' | sort > "$dynsyms"
# Extract all the text (i.e. function) symbols from the debuginfo
- nm "$debuginfo" --format=posix --defined-only | awk '{ if ($2 == "T" || $2 == "t") print $1 }' | sort > "$funcsyms"
+ # Use format sysv to make sure we can match against the actual ELF FUNC
+ # symbol type. The binutils nm posix format symbol type chars are
+ # ambigous for architectures that might use function descriptors.
+ nm "$debuginfo" --format=sysv --defined-only | awk -F \| '{ if ($4 ~ "FUNC") print $1 }' | sort > "$funcsyms"
# Keep all the function symbols not already in the dynamic symbol table
comm -13 "$dynsyms" "$funcsyms" > "$keep_symbols"
# Copy the full debuginfo, keeping only a minumal set of symbols and removing some unnecessary sections