test: read 20 ELF header bytes so e_machine at 18 is present
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-12 15:39:09
Commit2d46a6a0
Parents3f91265c
Changed files
tests/run.sh+1−1■■
1 file+1−1
Diff
tests/run.sh+1−1■■
index c23b37a..e8913ad 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -553,7 +553,7 @@ if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
553553 # verified by its header instead of by running it.
554554 if python3 - "$FIX/arm-bin" <<'PY'
555555 import sys
556-b = open(sys.argv[1], "rb").read(18)
556+b = open(sys.argv[1], "rb").read(20)
557557 # ELF magic, class 2 (64-bit), little endian; e_machine sits at offset 18
558558 # (e_type is at 16) and 183 = AArch64.
559559 ok = b[:4] == b"\x7fELF" and b[4] == 2 and b[5] == 1
560560
tests/run.sh+1−1■■
index c23b37a..e8913ad 100755index c23b37a..e8913ad 100755
--- a/tests/run.sh--- a/tests/run.sh
+++ b/tests/run.sh+++ b/tests/run.sh
@@ -553,7 +553,7 @@ if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then@@ -553,7 +553,7 @@ if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
553 # verified by its header instead of by running it.553 # verified by its header instead of by running it.
554 if python3 - "$FIX/arm-bin" <<'PY'554 if python3 - "$FIX/arm-bin" <<'PY'
555 import sys555 import sys
556-b = open(sys.argv[1], "rb").read(18)556+b = open(sys.argv[1], "rb").read(20)
557 # ELF magic, class 2 (64-bit), little endian; e_machine sits at offset 18557 # ELF magic, class 2 (64-bit), little endian; e_machine sits at offset 18
558 # (e_type is at 16) and 183 = AArch64.558 # (e_type is at 16) and 183 = AArch64.
559 ok = b[:4] == b"\x7fELF" and b[4] == 2 and b[5] == 1559 ok = b[:4] == b"\x7fELF" and b[4] == 2 and b[5] == 1
560560