chantra / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
648606
diff -up rpm-4.11.1/scripts/find-debuginfo.sh.minidebug-ppc64 rpm-4.11.1/scripts/find-debuginfo.sh
648606
--- rpm-4.11.1/scripts/find-debuginfo.sh.minidebug-ppc64	2014-01-16 14:05:17.291955782 +0200
648606
+++ rpm-4.11.1/scripts/find-debuginfo.sh	2014-01-16 14:05:56.437285842 +0200
648606
@@ -149,7 +149,10 @@ add_minidebug()
648606
   # in the normal symbol table
648606
   nm -D "$binary" --format=posix --defined-only | awk '{ print $1 }' | sort > "$dynsyms"
648606
   # Extract all the text (i.e. function) symbols from the debuginfo 
648606
-  nm "$debuginfo" --format=posix --defined-only | awk '{ if ($2 == "T" || $2 == "t") print $1 }' | sort > "$funcsyms"
648606
+  # Use format sysv to make sure we can match against the actual ELF FUNC
648606
+  # symbol type. The binutils nm posix format symbol type chars are
648606
+  # ambigous for architectures that might use function descriptors.
648606
+  nm "$debuginfo" --format=sysv --defined-only | awk -F \| '{ if ($4 ~ "FUNC") print $1 }' | sort > "$funcsyms"
648606
   # Keep all the function symbols not already in the dynamic symbol table
648606
   comm -13 "$dynsyms" "$funcsyms" > "$keep_symbols"
648606
   # Copy the full debuginfo, keeping only a minumal set of symbols and removing some unnecessary sections