fix(il2cpp): resolve ELF ABS64 and GLOB_DAT image definitions (#11075)

Derive bounded ELF ABS64 and GLOB_DAT link-image values for IL2CPP module
scanning while preserving the default conservative relocation policy.
Retain ambiguous hash declarations, validate complete hash-table mappings,
and disclose runtime-binding limitations in CLI and MCP evidence.

Validation: 408 focused tests, check:fast and docs:check passed. Public
CLI/MCP and independently linked ARM64/x86-64 ELF arithmetic were checked;
the original Unity binaries remain unavailable.

Refs #10478
Related: #10495

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
Ysopwnableandgensokyo-dev authored and GitHub committed 2026-11-15 19:55:43 +08:00
1 parent cabd56ea71
commit 29dd58c96d
8 files changed
+569 -34

No files matched your search

@@ -54,6 +54,7 @@ const expectedAddress = (value: bigint | "no-body" | "unknown") =>
}
: { state: value, address: null, rva: null };
const expectedAddresses = FIXTURE_METHOD_ADDRESSES.map(expectedAddress);
// The provider selects a universal slice before linking, as here.
const link = (bytes: Buffer, architecture?: Il2cppBinaryArchitecture) =>
linkIl2cppBinary(
@@ -66,6 +67,26 @@ const link = (bytes: Buffer, architecture?: Il2cppBinaryArchitecture) =>
metadata,
facts,
);
it.each([183, 62])(
"links past unrelated ABS64 and GLOB_DAT records on ELF machine %d",
(machine) => {
const bytes = createElfFixture(createIl2cppBinaryFixture(), {
machine,
symbolDefinition: { value: FIXTURE_BINARY_BASE + 0xe00n },
unresolvedRelocations: [
...[0xe00, 0xe08, 0xe10].map((offset) => ({
offset,
kind: machine === 183 ? 257 : 1,
})),
...[0xe20, 0xe28, 0xe30].map((offset) => ({
offset,
kind: machine === 183 ? 1025 : 6,
})),
],
});
expect(link(bytes).method_addresses).toEqual(expectedAddresses);
},
);
// A type-table fallback needs the metadata to reference most of the table, as
// real builds do; referencing type 3 requires all four fixture entries.
const wholeTable = {