tidy/strip: Fix incorrect recognition of static binaries as relocatable ones
This commit is contained in:
parent
9151c44658
commit
5213a70b88
1 changed files with 6 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue