golang/go · error
unsupported architecture %q
Error message
unsupported architecture %q
What it means
Returned when both disasms[goarch] and byteOrders[goarch] are nil for the executable's GOARCH. The disassembler supports only 386, amd64, arm, arm64, loong64, ppc64, ppc64le, riscv64, s390x (see the disasms/byteOrders maps at disasm.go:442). Architectures like mips/mipsle/mips64/wasm have no disassembler entry and trip this guard.
Source
Thrown at src/cmd/internal/disasm/disasm.go:74
if err != nil {
return nil, err
}
pcln, err := e.PCLineTable()
if err != nil {
return nil, err
}
textStart, textBytes, err := e.Text()
if err != nil {
return nil, err
}
goarch := e.GOARCH()
disasm := disasms[goarch]
byteOrder := byteOrders[goarch]
if disasm == nil || byteOrder == nil {
return nil, fmt.Errorf("unsupported architecture %q", goarch)
}
// Filter out section symbols, overwriting syms in place.
keep := syms[:0]
for _, sym := range syms {
switch sym.Name {
case "runtime.text", "text", "_text", "runtime.etext", "etext", "_etext":
// drop
default:
keep = append(keep, sym)
}
}
syms = keep
d := &Disasm{
syms: syms,
pcln: pcln,
text: textBytes,
textStart: textStart,View on GitHub (pinned to b6b368adc5)
Solutions
- Confirm the binary's architecture with `go version <bin>` or `file <bin>` and that it is one of the supported set.
- If you need wasm/MIPS disassembly, use an external disassembler (wasm2wat, objdump from binutils for mips).
- Upgrade the Go toolchain — newly supported arches are added over time.
- Rebuild the binary for a supported GOARCH if disassembly is essential.
Defensive patterns
Strategy: validation
Validate before calling
supported := map[string]bool{"386":true,"amd64":true,"arm":true,"arm64":true,"loong64":true,"ppc64":true,"ppc64le":true,"riscv64":true,"s390x":true}
if !supported[goarch] {
return fmt.Errorf("objdump unsupported for GOARCH=%s", goarch)
} Prevention
- Check `go version <bin>` before invoking objdump.
- Keep an external disassembler (binutils objdump, wasm2wat) for unsupported arches.
- Upgrade the toolchain — support is added over releases.
When it happens
Trigger: Calling `go tool objdump` (or disasm.New on a binary) whose GOARCH is not in the supported set — e.g. a wasm binary, a MIPS binary, or any future/less-common arch. e.GOARCH() returns the arch string and the map lookup yields nil.
Common situations: Running objdump on GOOS=js GOARCH=wasm modules, on GOARCH=mips64le embedded targets, or cross-disassembling a binary built for an arch the toolchain doesn't disassemble. Also after a toolchain downgrade that drops a recently added arch.
Related errors
- failed to locate cmd/go for target platform
- failed to locate cmd/compile for target platform
- GOROOT not found
- ${GoModToolVersion} is required for tool directives in go.mo
- tool %q is ambiguous; choose one of:
AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12).
Data as JSON: /api/errors/f6cb388aa13c0d88.
Report an issue: GitHub.