summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornickclifton <31441682+nickclifton@users.noreply.github.com>2019-06-19 12:45:09 +0100
committerPanu Matilainen <pmatilai@redhat.com>2020-03-26 11:57:58 +0200
commit1f0e8fd1317117dabf0d2e35b636dfb39e382d74 (patch)
tree989cf871841fef87f2b67083f02ca771e77222fb
parentbfd61426cb2b75fd90c85408941799dae957e7d7 (diff)
downloadrpm-1f0e8fd1317117dabf0d2e35b636dfb39e382d74.tar.gz
Add step to find-debuginfo.sh script to compress annobin notes.
With the introduction of the annobin gcc plugin to the build process, built binary files have become larger. Sometimes significantly so. This is a patch that adds a new step to the post-link process performed by rpmbuild, to run the objcopy program with the --merge-notes option specified. This will reduce the size of the annobin notes in binary files, thus alleviating the size growth. (cherry picked from commit cc1965ce3acaa7d9356b7671050a15e2cda2f424)
-rwxr-xr-xscripts/find-debuginfo.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index c16299600..d837a6b4b 100755
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -388,6 +388,10 @@ do_file()
fi
fi
+ # Compress any annobin notes in the original binary.
+ # Ignore any errors, since older objcopy don't support --merge-notes.
+ objcopy --merge-notes "$f" 2>/dev/null || true
+
# A binary already copied into /usr/lib/debug doesn't get stripped,
# just has its file names collected and adjusted.
case "$dn" in