- [ -n "$EXCLUDE_FULL_REGEXP" ] && grep -E -q "$EXCLUDE_FULL_REGEXP" <<< "$2" && g=-g
-
-- eu-strip --remove-comment $g $([ -n "$DISABLE_DEBUG" ] || echo -f "$1") "$2" || exit
-- [ -n "$DISABLE_DEBUG" ] || chmod 444 "$1" || exit
-+ [ -n "$DISABLE_DEBUG" ] && return
-+ objcopy --only-keep-debug --remove-section .comment "$2" "$1" || exit
-+ objcopy --add-gnu-debuglink="$1" "$2" || exit
-+ chmod 444 "$1" || exit
+- eu-strip --remove-comment $r $g ${keep_remove_args} -f "$1" "$2" || exit
++ local t=$(mktemp "/tmp/rpm.stripped.XXXXXX")
++ objcopy --compress-debug-sections "$2" || exit
++ eu-strip --remove-comment $r -f "$1" "$2" -o "$t" || exit
++ rm -f "$t"
+ chmod 444 "$1" || exit