Minisymtab should only be added for executables or shared libraries.

This commit is contained in:
Mark Wielaard 2017-04-16 18:23:20 +02:00
parent f90c3447a3
commit e589ca1992
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,35 @@
commit 95822abd90b9b3991b15ba82193abb5b9998dc99
Author: Mark Wielaard <mark@klomp.org>
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 <mark@klomp.org>
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"

View File

@ -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 <mjw@fedoraproject.org>
- Minisymtab should only be added for executables or shared libraries.
* Fri Mar 31 2017 Panu Matilainen <pmatilai@redhat.com> - 4.13.0.1-18
- gpg path must not depend on %%_prefix and such (#1437726)