rust-lang/rust · error
binary format {:?} is not supported
Error message
binary format {:?} is not supported What it means
compiler-builtins' symbol-check tool verifies that object files do not require an executable stack. In check_obj_exe_stack it handles Elf, MachO, Coff/Pe, and Wasm formats; for XCOFF or any other/unrecognized format it hits unimplemented!() (symbol-check/src/main.rs:425). The tool simply has no extractor for that binary format.
Source
Thrown at library/compiler-builtins/crates/symbol-check/src/main.rs:425
}
exit(1);
}
/// `Err` if the section/flag combination indicates that the object file should be linked with an
/// executable stack.
fn check_obj_exe_stack(obj: &ObjFile) -> Result<(), ExeStack> {
match obj.format() {
BinaryFormat::Elf => check_elf_exe_stack(obj),
// Technically has the `MH_ALLOW_STACK_EXECUTION` flag but I can't get the compiler to
// emit it (`-allow_stack_execute` doesn't seem to work in recent versions).
BinaryFormat::MachO => Ok(()),
// Can't find much information about Windows stack executability.
BinaryFormat::Coff | BinaryFormat::Pe => Ok(()),
// Also not sure about wasm.
BinaryFormat::Wasm => Ok(()),
BinaryFormat::Xcoff | _ => {
unimplemented!("binary format {:?} is not supported", obj.format())
}
}
}
/// Check for an executable stack in elf binaries.
///
/// If the `PT_GNU_STACK` header on a binary is present and marked executable, the binary will
/// have an executable stack (RWE rather than the desired RW). If any object file has the right
/// `.note.GNU-stack` logic, the final binary will get `PT_GNU_STACK`.
///
/// Individual object file logic is as follows, paraphrased from [1]:
///
/// - A `.note.GNU-stack` section with the exe flag means this needs an executable stack
/// - A `.note.GNU-stack` section without the exe flag means there is no executable stack needed
/// - Without the section, behavior is target-specific. Historically it usually means an executable
/// stack is required.
///
/// Per [2], it is now deprecated behavior for a missing `.note.GNU-stack` section to imply anView on GitHub (pinned to 7088e4b63a)
Solutions
- Only run symbol-check against object files in a supported format (Elf/MachO/Coff/Pe/Wasm); skip XCOFF artifacts.
- Filter input objects by format before calling check_obj_exe_stack, e.g. skip if matches!(obj.format(), BinaryFormat::Xcoff).
- Upstream an XCOFF executable-stack checker if you need AIX support.
- Run a different stack-audit tool (e.g. readelf/objdump) for the unsupported format.
Example fix
// before
let r = check_obj_exe_stack(&obj);
// after
if !matches!(obj.format(), BinaryFormat::Elf | BinaryFormat::MachO | BinaryFormat::Coff | BinaryFormat::Pe | BinaryFormat::Wasm) {
println!("skipping {}: format {:?} unsupported", obj.path().display(), obj.format());
continue;
}
let r = check_obj_exe_stack(&obj); Defensive patterns
Strategy: validation
Validate before calling
use object::BinaryFormat;
fn is_stack_check_supported(fmt: BinaryFormat) -> bool {
matches!(fmt, BinaryFormat::Elf | BinaryFormat::MachO | BinaryFormat::Coff | BinaryFormat::Pe | BinaryFormat::Wasm)
}
// Only call check_obj_exe_stack when is_stack_check_supported(obj.format()) is true. Prevention
- Filter object files by BinaryFormat before stack-auditing.
- Skip XCOFF and unknown formats in your symbol-check pipeline.
- Run a target-specific stack auditor for unsupported formats.
When it happens
Trigger: Running the symbol-check binary (part of the compiler-builtins build/check pipeline) against an object file whose format is XCOFF (AIX) or any format outside {Elf, MachO, Coff, Pe, Wasm}. obj.format() returns something that falls through the match.
Common situations: Building or auditing compiler-builtins for an AIX/XCOFF target, or pointing symbol-check at an unusual object format (e.g. a raw relocatable or a new experimental format).
AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10).
Data as JSON: /api/errors/b9f4a666056bdae8.
Report an issue: GitHub.