refactor(elf): share fixed header declaration widths (#12391)

This commit is contained in:
morluto authored and GitHub committed 2026-11-19 15:59:06 +00:00
1 parent ad996352c3
commit 1ba93c8a1b
18 files changed
+184 -96

No files matched your search

+5 -2
View File
@@ -17,7 +17,10 @@ import {
} from "../../domain/peSectionHeader.js";
import { readElfHeaderFacts } from "../../domain/elfFixedHeader.js";
import { readElfRawTableDeclarations } from "../../domain/elfRawTableDeclarations.js";
import { readElfSectionHeader } from "../../domain/elfSectionHeader.js";
import {
elfSectionHeaderWidth,
readElfSectionHeader,
} from "../../domain/elfSectionHeader.js";
import { observeElfStringTableEntry } from "../../domain/elfStringTable.js";
import {
readFatContainerHeader,
@@ -808,7 +811,7 @@ const elfClaims = async (
const declarations = readElfRawTableDeclarations(header, format.value);
if (!declarations.ok) return [];
const { offset, width, count, namesIndex } = declarations.value.sections;
const sectionWidth = elfClass === 64 ? 64 : 40;
const sectionWidth = elfSectionHeaderWidth(elfClass);
// Unsupported extended numbering does not establish a Bun graph.
if (
(width !== 0 && width !== sectionWidth) ||