mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 21:23:45 +00:00
fix(elf): admit Xtensa through canonical target contracts (#11178)
Admit ELF machine 94 as the canonical Xtensa family through Ghidra's header-selected import. Share generic-header exclusions between static target types and live CLI/MCP summaries, preserving ELF-only format constraints and other providers' decline paths. Fixes #10765. Adapted from #10774. Co-authored-by: Josh <joshuakrishna21@gmail.com> Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
12 files changed
+109
-21
No files matched your search
@@ -14,6 +14,7 @@ export const BINARY_ARCHITECTURES = [
|
||||
"powerpc",
|
||||
"m68k",
|
||||
"hexagon",
|
||||
"xtensa",
|
||||
] as const;
|
||||
export type BinaryArchitecture = (typeof BINARY_ARCHITECTURES)[number];
|
||||
|
||||
@@ -62,10 +63,19 @@ export const isElfMetadataArchitecture = (
|
||||
): architecture is ElfMetadataArchitecture =>
|
||||
(ELF_METADATA_ARCHITECTURES as readonly string[]).includes(architecture);
|
||||
|
||||
/** Recognized family with no ELF metadata member; the header alone is the fact. */
|
||||
/** Families that require a specialized target variant instead of generic headers. */
|
||||
export const HEADER_ARCHITECTURE_EXCLUSIONS = [
|
||||
...ELF_METADATA_ARCHITECTURES,
|
||||
...RAW_ONLY_ARCHITECTURES,
|
||||
"hexagon",
|
||||
"xtensa",
|
||||
"arm64_32",
|
||||
] as const satisfies readonly BinaryArchitecture[];
|
||||
|
||||
/** Recognized family with no specialized target member; the header alone is the fact. */
|
||||
export type HeaderArchitecture = Exclude<
|
||||
BinaryArchitecture,
|
||||
ElfMetadataArchitecture | RawOnlyArchitecture | "hexagon" | "arm64_32"
|
||||
(typeof HEADER_ARCHITECTURE_EXCLUSIONS)[number]
|
||||
>;
|
||||
|
||||
/** Raw ELF facts; family recognition does not establish ISA or ABI support. */
|
||||
@@ -212,6 +222,14 @@ export type BinaryTarget =
|
||||
readonly executableRole?: never;
|
||||
readonly managed?: never;
|
||||
})
|
||||
| (BinaryTargetIdentity & {
|
||||
readonly kind: "executable";
|
||||
readonly format: "elf";
|
||||
readonly architecture: "xtensa";
|
||||
readonly availableArchitectures: readonly "xtensa"[];
|
||||
readonly executableRole?: never;
|
||||
readonly managed?: never;
|
||||
})
|
||||
| (BinaryTargetIdentity & {
|
||||
readonly kind: "executable";
|
||||
readonly format: "mach-o";
|
||||
|
||||
Reference in new issue
Block a user