refactor: consolidate binary artifact interpretation and fixture ownership

Share exact ELF program-header facts across nine consumers while preserving their admission and precision policies. Centralize conformance path and digest binding, retain verifier-specific checks, and route fixture-owner changes to CI qualification.
This commit is contained in:
morluto committed 2026-10-26 16:21:11 +08:00
1 parent 23bc51d5c4
commit 9341b116ef
20 files changed
+484 -144

No files matched your search

+23 -12
View File
@@ -1,3 +1,4 @@
import { readElfProgramHeader } from "../../domain/elfProgramHeader.js";
import { readElfRawTableDeclarations } from "../../domain/elfRawTableDeclarations.js";
import { createHash } from "node:crypto";
import { parsePeResources } from "../../native/pe/PeResourceParser.js";
@@ -353,18 +354,28 @@ const locateElfNotes = async (
if (programs === undefined) opaque = phnum > 0;
else
for (const entry of programs) {
if (readU32(entry, 0, little) !== PT_NOTE) continue;
const note = elf64
? {
offset: readU64(entry, 8, little),
length: readU64(entry, 32, little),
align: readU64(entry, 48, little),
}
: {
offset: readU32(entry, 4, little),
length: readU32(entry, 16, little),
align: readU32(entry, 28, little),
};
const parsedProgram = readElfProgramHeader(
entry,
header.value.elfClass,
little,
);
if (!parsedProgram.ok) continue;
const program = parsedProgram.value;
if (program.type !== PT_NOTE) continue;
const note = {
offset:
program.offset <= BigInt(Number.MAX_SAFE_INTEGER)
? Number(program.offset)
: undefined,
length:
program.fileSize <= BigInt(Number.MAX_SAFE_INTEGER)
? Number(program.fileSize)
: undefined,
align:
program.alignment <= BigInt(Number.MAX_SAFE_INTEGER)
? Number(program.alignment)
: undefined,
};
const scanned = await scanElfNoteTable(
carrier,
note,