wuyuoss / rpms / rpm

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