From 5213a70b88a97bbe4c513922e83737fc725be6e0 Mon Sep 17 00:00:00 2001 From: Vasiliy Stelmachenok Date: Mon, 1 Jul 2024 09:26:59 +0300 Subject: tidy/strip: Fix incorrect recognition of static binaries as relocatable ones --- scripts/libmakepkg/tidy/strip.sh.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index 0b44004c..2ab68479 100644 --- a/scripts/libmakepkg/tidy/strip.sh.in +++ b/scripts/libmakepkg/tidy/strip.sh.in @@ -167,7 +167,12 @@ tidy_strip() { *Type:*'DYN (Position-Independent Executable file)'*) # Relocatable binaries strip_flags="$STRIP_SHARED";; *Type:*'EXEC (Executable file)'*) # Binaries - strip_flags="$STRIP_BINARIES";; + if [[ "$(readelf -x .dynamic "$binary" 2>/dev/null)" ]]; then + strip_flags="$STRIP_BINARIES" + else + strip_flags="$STRIP_STATIC" + fi + ;; *Type:*'REL (Relocatable file)'*) # Libraries (.a) or objects if ar t "$binary" &>/dev/null; then # Libraries (.a) strip_flags="$STRIP_STATIC" -- cgit v1.2.3-70-g09d2