From 510da186f2b56a74e88d76bb1a84994aebc2efad Mon Sep 17 00:00:00 2001 From: nickclifton <31441682+nickclifton@users.noreply.github.com> Date: Apr 23 2020 14:26:58 +0000 Subject: 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. --- diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh index dd524a9..d8ac0c8 100755 --- a/scripts/find-debuginfo.sh +++ b/scripts/find-debuginfo.sh @@ -405,6 +405,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