From e589ca199258b3887bd77cdc47346732ccf535ec Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Apr 16 2017 16:23:20 +0000 Subject: Minisymtab should only be added for executables or shared libraries. --- diff --git a/0023-minisymtab-exe-sh.patch b/0023-minisymtab-exe-sh.patch new file mode 100644 index 0000000..9ad8630 --- /dev/null +++ b/0023-minisymtab-exe-sh.patch @@ -0,0 +1,35 @@ +commit 95822abd90b9b3991b15ba82193abb5b9998dc99 +Author: Mark Wielaard +Date: Sat Apr 15 13:34:18 2017 +0200 + + find-debuginfo.sh: Only add minisymtab for executables or shared libraries. + + It only makes sense to add a minisymtab for executables and shared + libraries. Other executable ELF files (like kernel modules) don't need it. + Since those don't have a dynsym section trying to add it will fail and + produce confusing errors from nm. + + Signed-off-by: Mark Wielaard + +diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh +index 6f38e19..39bb0b7 100755 +--- a/scripts/find-debuginfo.sh ++++ b/scripts/find-debuginfo.sh +@@ -358,7 +358,16 @@ do_file() + fi + + # strip -g implies we have full symtab, don't add mini symtab in that case. +- $strip_g || ($include_minidebug && add_minidebug "${debugfn}" "$f") ++ # It only makes sense to add a minisymtab for executables and shared ++ # libraries. Other executable ELF files (like kernel modules) don't need it. ++ if [ "$include_minidebug" = "true" -a "$strip_g" = "false" ]; then ++ skip_mini=true ++ case "$(file -bi "$f")" in ++ application/x-sharedlib*) skip_mini=false ;; ++ application/x-executable*) skip_mini=false ;; ++ esac ++ $skip_mini || add_minidebug "${debugfn}" "$f" ++ fi + + echo "./${f#$RPM_BUILD_ROOT}" >> "$ELFBINSFILE" + diff --git a/rpm.spec b/rpm.spec index 1301c60..e8b2855 100644 --- a/rpm.spec +++ b/rpm.spec @@ -98,6 +98,7 @@ Patch268: 0019-fix-sed-build-id-match-test.patch Patch269: 0020-build-files-exec-build-id.patch Patch270: 0021-debugedit-Fix-off-by-one-adding-DW_FORM_string-repla.patch Patch271: 0022-unbreak-short-circuit.patch +Patch272: 0023-minisymtab-exe-sh.patch # OpenSSL backend Patch300: 0001-Add-OpenSSL-support-for-digest-and-signatures.patch @@ -604,6 +605,9 @@ exit 0 %doc doc/librpm/html/* %changelog +* Sat Apr 15 2017 Mark Wielaard +- Minisymtab should only be added for executables or shared libraries. + * Fri Mar 31 2017 Panu Matilainen - 4.13.0.1-18 - gpg path must not depend on %%_prefix and such (#1437726)