summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasiliy Stelmachenok <ventureo@yandex.ru>2024-07-01 09:26:59 +0300
committerAllan McRae <allan@archlinux.org>2024-07-06 09:09:37 +0000
commit5213a70b88a97bbe4c513922e83737fc725be6e0 (patch)
tree5c9bae241f138f2b22bda6271fb917f5ef210497
parent9151c446583d0e4fd866c6d951271d6eb36cbc6c (diff)
tidy/strip: Fix incorrect recognition of static binaries as relocatable ones
-rw-r--r--scripts/libmakepkg/tidy/strip.sh.in7
1 files changed, 6 insertions, 1 deletions
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"