test: e_machine lives at ELF offset 18, not 16
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-12 15:38:14
Commit3f91265c
Parents1ede447c
Changed files
tests/run.sh+3−2■■■■■
1 file+3−2
Diff
tests/run.sh+3−2■■■■■
index f239dc5..c23b37a 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -554,9 +554,10 @@ if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
554554 if python3 - "$FIX/arm-bin" <<'PY'
555555 import sys
556556 b = open(sys.argv[1], "rb").read(18)
557-# ELF magic, class 2 (64-bit), little endian, e_machine 183 = AArch64
557+# ELF magic, class 2 (64-bit), little endian; e_machine sits at offset 18
558+# (e_type is at 16) and 183 = AArch64.
558559 ok = b[:4] == b"\x7fELF" and b[4] == 2 and b[5] == 1
559-ok = ok and int.from_bytes(b[16:18], "little") == 183
560+ok = ok and int.from_bytes(b[18:20], "little") == 183
560561 sys.exit(0 if ok else 1)
561562 PY
562563 then pass "the arm artifact is a little-endian aarch64 ELF"
563564
tests/run.sh+3−2■■■■■
index f239dc5..c23b37a 100755index f239dc5..c23b37a 100755
--- a/tests/run.sh--- a/tests/run.sh
+++ b/tests/run.sh+++ b/tests/run.sh
@@ -554,9 +554,10 @@ if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then@@ -554,9 +554,10 @@ if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
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(18)
557-# ELF magic, class 2 (64-bit), little endian, e_machine 183 = AArch64557+# ELF magic, class 2 (64-bit), little endian; e_machine sits at offset 18
558+# (e_type is at 16) and 183 = AArch64.
558 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
559-ok = ok and int.from_bytes(b[16:18], "little") == 183560+ok = ok and int.from_bytes(b[18:20], "little") == 183
560 sys.exit(0 if ok else 1)561 sys.exit(0 if ok else 1)
561 PY562 PY
562 then pass "the arm artifact is a little-endian aarch64 ELF"563 then pass "the arm artifact is a little-endian aarch64 ELF"
563564