From b976b009e225d0f9856d76e6b48250de0d81b6f9 Mon Sep 17 00:00:00 2001 From: Mikhail Kashkarov Date: Tue, 30 Jul 2019 23:50:49 +0300 Subject: Fix binutils strip support 1. Debug information was not connected with stripped part without .gnu_debuglink (eu-strip creates this section automatically) 2. chmod 444 was wrongly propagated to the binaries with the same .debug.id when we put stripped output in the initial input. Change-Id: Ie82a46daf8d8aaea0c3f31d97e99fabc6e8bf68f --- scripts/find-debuginfo.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 scripts/find-debuginfo.sh diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh old mode 100644 new mode 100755 index 97e052d94..e4fffe4b5 --- a/scripts/find-debuginfo.sh +++ b/scripts/find-debuginfo.sh @@ -139,8 +139,9 @@ strip_to_debug() if [ "$STRIP_DEFAULT_PACKAGE" != "binutils" ]; then eu-strip --remove-comment $g $strip_option -f "$1" "$2" || exit else - mv $2 $1 - strip --remove-section=.comment $g $strip_option -o "$2" "$1" || exit + cp "$2" "$1" + strip --remove-section=.comment $g $strip_option "$2" || exit + objcopy --add-gnu-debuglink="$1" "$2" || exit fi esac chmod 444 "$1" || exit -- cgit v1.2.3