{"record":{"id":"88d80448d17f2fe0","repo":"golang/go","slug":"internal-error-in-windynrelocsym-unsupported-arch","errorCode":null,"errorMessage":"internal error in windynrelocsym: unsupported arch %v","messagePattern":"internal error in windynrelocsym: unsupported arch (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/cmd/link/internal/ld/data.go","lineNumber":898,"sourceCode":"\t\t\t// Consistency check: don't want to see both PLT and GOT tokens.\n\t\t\tif tgot != -1 {\n\t\t\t\treturn fmt.Errorf(\"internal error in windynrelocsym: invalid GOT setting %d for reloc to %s\", tgot, ctxt.loader.SymName(targ))\n\t\t\t}\n\n\t\t\t// make dynimport JMP table for PE object files.\n\t\t\ttplt := int32(rel.Size())\n\t\t\tctxt.loader.SetPlt(targ, tplt)\n\n\t\t\tif su == nil {\n\t\t\t\tsu = ctxt.loader.MakeSymbolUpdater(s)\n\t\t\t}\n\t\t\tr.SetSym(rel.Sym())\n\t\t\tr.SetAdd(int64(tplt))\n\n\t\t\t// jmp *addr\n\t\t\tswitch ctxt.Arch.Family {\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"internal error in windynrelocsym: unsupported arch %v\", ctxt.Arch.Family)\n\t\t\tcase sys.I386:\n\t\t\t\trel.AddUint8(0xff)\n\t\t\t\trel.AddUint8(0x25)\n\t\t\t\trel.AddAddrPlus(ctxt.Arch, targ, 0)\n\t\t\t\trel.AddUint8(0x90)\n\t\t\t\trel.AddUint8(0x90)\n\t\t\tcase sys.AMD64:\n\t\t\t\t// The relocation symbol might be at an absolute offset\n\t\t\t\t// higher than 32 bits, but the jump instruction can't\n\t\t\t\t// encode more than 32 bit offsets. We use a jump\n\t\t\t\t// relative to the instruction pointer to get around this\n\t\t\t\t// limitation.\n\t\t\t\trel.AddUint8(0xff)\n\t\t\t\trel.AddUint8(0x25)\n\t\t\t\trel.AddPCRelPlus(ctxt.Arch, targ, 0)\n\t\t\t\trel.AddUint8(0x90)\n\t\t\t\trel.AddUint8(0x90)\n\t\t\tcase sys.ARM64:","sourceCodeStart":880,"sourceCodeEnd":916,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/link/internal/ld/data.go#L880-L916","documentation":"An internal error in windynrelocsym during PE import JMP stub code generation. The switch on ctxt.Arch.Family generates architecture-specific JMP instructions (e.g. jmp *addr). If the architecture family is not one of the supported cases (sys.I386, sys.AMD64, and potentially others), the default branch rejects it. This code path is Windows-specific and only runs for architectures where PE dynamic imports are implemented.","triggerScenarios":"windynrelocsym generates a JMP stub for a PE import. The switch on ctxt.Arch.Family hits the default case, meaning the architecture is not supported for PE import stub generation. This could occur if a new Windows architecture is being targeted but the stub generator has not been updated.","commonSituations":"Building for a Windows architecture that lacks PE import stub support (e.g. experimental GOARCH values); a misconfigured cross-compilation environment; using a Go version that does not yet support the target architecture for PE dynamic linking.","solutions":["Verify the target GOARCH is supported for Windows PE dynamic linking in your Go version","Check Go release notes for architecture support status","Use a Go version that supports the target architecture","If the architecture should be supported, report at https://github.com/golang/go/issues","Fall back to -linkmode=external if the external linker supports the architecture"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Check architecture support for PE dynamic imports before building\nfunc isArchSupportedForPEDynImport(family sys.ArchFamily) bool {\n    switch family {\n    case sys.I386, sys.AMD64:\n        return true\n    // Add ARM64 if supported by your Go version\n    default:\n        return false\n    }\n}","typeGuard":null,"tryCatchPattern":"// Fall back to external linker for unsupported architectures\nif !isArchSupportedForPEDynImport(ctxt.Arch.Family) {\n    log.Printf(\"PE dynamic imports not supported on %v, using external linker\", ctxt.Arch.Family)\n    return useExternalLinker()\n}","preventionTips":["Verify GOARCH is supported for Windows PE dynamic linking in your Go version","Check Go release notes for Windows architecture support status","Use -linkmode=external if the internal linker lacks architecture support for PE imports"],"tags":["relocation","windows","pe","linker","go-toolchain","architecture","internal-error"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}