Fix binutils strip support 75/211175/4
authorMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Tue, 30 Jul 2019 20:50:49 +0000 (23:50 +0300)
committerMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Thu, 1 Aug 2019 11:02:12 +0000 (14:02 +0300)
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 [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 97e052d..e4fffe4
@@ -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