Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
leleliu008 committed Jan 17, 2025
1 parent d57538c commit 2c4f899
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ndk-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -7204,10 +7204,13 @@ __check_elf_files() {

[ "$FILETYPE" = f ] || continue

"$CHECKER" "$FILEPATH" || continue

FILE_HEADER_ACTUAL="$(xxd -u -p -l 20 "$FILEPATH")"

case $FILE_HEADER_ACTUAL in
7F454C46*) ;;
*) printf "NOT an ELF file: %s\n" "$FILEPATH" >&2 ; continue
esac

# http://www.sco.com/developers/gabi/latest/ch4.eheader.html
ELF_TYPE="$(printf '%s\n' "$FILE_HEADER_ACTUAL" | cut -c33-34)"

Expand All @@ -7227,6 +7230,8 @@ __check_elf_files() {
# 03 means it is a shared library or dynamically linked executable
[ "$ELF_TYPE" = '03' ] || continue

"$CHECKER" "$FILEPATH" || continue

# patchelf would report a error if there is no '.interp' section in a ELF file
DYNAMIC_LINKER_PATH="$(patchelf --print-interpreter "$FILEPATH" 2>/dev/null || true)"

Expand Down Expand Up @@ -9495,7 +9500,7 @@ fi
fi
}

NDKPKG_VERSION=0.19.7
NDKPKG_VERSION=0.19.8

NDKPKG_ARG0="$0"
NDKPKG_ARG1="$1"
Expand Down

0 comments on commit 2c4f899

Please sign in to comment.