diff --git a/scripts/find-debuginfo-files.in b/scripts/find-debuginfo-files.in index 150c1d9..6314075 100755 --- a/scripts/find-debuginfo-files.in +++ b/scripts/find-debuginfo-files.in @@ -34,6 +34,9 @@ while read -r f; do else Warning "Expected $f not found." fi + if [ -L ".$f.debug" ] && [ -e ".$f.debug" ]; then + printf '%s\n' "$f.debug" >> .tmp/links + fi fi fbin=$f # Actual binary for linking diff --git a/scripts/process-debuginfo.in b/scripts/process-debuginfo.in index bc2e31f..889c010 100755 --- a/scripts/process-debuginfo.in +++ b/scripts/process-debuginfo.in @@ -20,6 +20,7 @@ rezip= elfcompress= strip_rel= strip_btf='--keep-section=.BTF' +debuglink= if [ -z "${f#./lib/modules/*.ko}" ]; then elfcompress=yes @@ -56,6 +57,7 @@ elif [ -z "${f##./boot/vmlinuz-*}" ]; then if [ -f "$vmlinuxs" ]; then install -pD -m644 "$vmlinuxs" "$vmlinuxd" f=$vmlinuxd + debuglink="$vmlinuxd.debug" else Warning "vmlinux not found in $RPM_BUILD_DIR for -debuginfo" exit @@ -104,6 +106,7 @@ fi if [ -n "$strip" ]; then mkdir -p "${debugf%/*}" LD_ORIGIN_PATH=/usr/bin eu-strip $strip $strip_rel $strip_btf --remove-comment -f "$debugf" "$f" + [ -z "$debuglink" ] || ln -sr "$debugf" "$debuglink" if [ -n "$elfcompress" ] && [ -x /usr/bin/eu-elfcompress ]; then LD_ORIGIN_PATH=/usr/bin eu-elfcompress --quiet "$debugf"