Don't try to apply patchelf to non-ELF binaries

This commit is contained in:
Eelco Dolstra
2016-02-18 22:54:11 +01:00
parent bf63de1613
commit d71a4851e8
3 changed files with 23 additions and 13 deletions
+11
View File
@@ -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.