From 457fef1d64176b6f7228c9baf02b8e45b0dcbc0d Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Tue, 15 Dec 2020 04:36:52 +0300 Subject: [PATCH] debuginfo: strip --reloc-debug-sections for kernel modules `--reloc-debug-sections` resolves trivial relocs between debug sections and designed for use on kernel modules debug (.ko.debug) reducing their sizes. --- scripts/process-debuginfo.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/process-debuginfo.in b/scripts/process-debuginfo.in index 6dbfb7d..e471ad3 100755 --- a/scripts/process-debuginfo.in +++ b/scripts/process-debuginfo.in @@ -18,9 +18,11 @@ mkdir -p .tmp f=$1 rezip= elfcompress= +strip_rel= if [ -z "${f#./lib/modules/*.ko}" ]; then elfcompress=yes + strip_rel="--reloc-debug-sections" elif [ -z "${f#./lib/modules/*.ko.[gx]z}" ]; then rezip=${f##*.} rezip=${rezip/gz/gzip} @@ -28,6 +30,7 @@ elif [ -z "${f#./lib/modules/*.ko.[gx]z}" ]; then $rezip --decompress --force "$f" f=${f%.[gx]z} elfcompress=yes + strip_rel="--reloc-debug-sections" elif [ -z "${f##./boot/vmlinuz-*}" ]; then # Compressed kernel: trigger extraction of vmlinux from the source. kver=${f#./boot/vmlinuz-} @@ -81,7 +84,7 @@ if [ ! -s .tmp/src.$$ ] && [ -x /usr/bin/eu-elfcompress ]; then fi if [ -n "$strip" ]; then mkdir -p "${debugf%/*}" - LD_ORIGIN_PATH=/usr/bin eu-strip $strip --remove-comment -f "$debugf" "$f" + LD_ORIGIN_PATH=/usr/bin eu-strip $strip $strip_rel --remove-comment -f "$debugf" "$f" if [ -n "$elfcompress" ] && [ -x /usr/bin/eu-elfcompress ]; then LD_ORIGIN_PATH=/usr/bin eu-elfcompress --quiet "$debugf"