feat(binary-layout): admit ELF64 AArch64 and name the refused host (#8711)

* feat(binary-layout): admit ELF64 AArch64 and name the refused host

inspect_binary_layout refused every AArch64 ELF, and on a non-x64 host the
refusal read "supports Linux x64 only", which looked like a target refusal
(#8709 ran on arm64 WSL and suspected an e_machine check).

The pwntools adapter now admits little-endian ELF64 AArch64 EXEC/DYN/REL
objects alongside the existing profiles, pwntools must report aarch64/64/
little, and the Evidence subject names arm64. The host refusal now names the
detected platform/arch and says the target was not read; the host check
itself is unchanged.

verify:binary:layout cross-compiles an AArch64 executable and relocatable
object (never executed) and checks sections, symbols and relocations
against GNU readelf, decoding ELF64 r_info as a 32-bit type under a 32-bit
symbol index. The real-binary-layout workflow installs the toolchain.

Refs #8709

* test(binary-layout): refuse RISC-V as the unsupported machine and assert the host refusal path

verify:binary:layout used e_machine 183 (AArch64) as its unsupported
target, which this branch now admits; use EM_RISCV (243) instead.

The unsupported-host provider test now asserts the refusal names this
host's platform/arch and says the target was not read, so reverting the
decoder to the old message fails it.
This commit is contained in:
JANG BYUNGKUN authored and GitHub committed 2026-11-03 09:37:41 +08:00
1 parent eef8f44003
commit 6442ea02cb
13 files changed
+75 -37

No files matched your search

+4 -1
View File
@@ -122,6 +122,9 @@ it("retains high linked values and NOBITS without inventing file backing", () =>
});
it.each([
[{ machine: "EM_AARCH64", bits: 64, byte_order: "little" }, true],
[{ machine: "EM_AARCH64", bits: 64, byte_order: "big" }, false],
[{ machine: "EM_AARCH64", bits: 32, byte_order: "little" }, false],
[{ machine: "EM_386", bits: 32, byte_order: "little" }, true],
[{ machine: "EM_ARM", bits: 32, byte_order: "little" }, true],
[{ machine: "EM_MIPS", bits: 32, byte_order: "little" }, true],
@@ -150,7 +153,7 @@ it.each([
if (problem === "file-backed-outside") section.file_backing = "file";
if (problem === "header-outside") section.header_location.offset = "0x80";
if (problem === "wrong-index") section.index = 1;
if (problem === "wrong-machine") value.architecture.machine = "EM_AARCH64";
if (problem === "wrong-machine") value.architecture.machine = "EM_RISCV";
if (problem === "outside-elf64")
value.entry_point.reported_value = "0x10000000000000000";
if (problem === "noncanonical-base64") section.name.bytes_base64 = "AR==";