Don't try to apply patchelf to non-ELF binaries
This commit is contained in:
@@ -180,6 +180,17 @@ installBin() {
|
||||
}
|
||||
|
||||
|
||||
# Return success if the specified file is an ELF object.
|
||||
isELF() {
|
||||
local fn="$1"
|
||||
local magic
|
||||
exec {fd}< "$fn"
|
||||
read -n 4 -u $fd magic
|
||||
exec {fd}<&-
|
||||
if [[ "$magic" =~ ELF ]]; then return 0; else return 1; fi
|
||||
}
|
||||
|
||||
|
||||
######################################################################
|
||||
# Initialisation.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user