golang/go · critical
internal error in windynrelocsym: invalid GOT setting %d for
Error message
internal error in windynrelocsym: invalid GOT setting %d for reloc to %s
What it means
An internal consistency error in windynrelocsym. When a symbol's PLT (Procedure Linkage Table) entry equals CreateImportStubPltToken, the code checks that the GOT entry is unset (tgot == -1). If both PLT and GOT tokens are present simultaneously, the symbol's relocation state is inconsistent — these tokens are mutually exclusive.
Source
Thrown at src/cmd/link/internal/ld/data.go:882
if err != nil {
return err
}
dstyp := ctxt.loader.SymType(ds)
if dstyp != sym.SWINDOWS {
return fmt.Errorf("internal error in windynrelocsym: underlying sym for %q has wrong type %s", sname, dstyp.String())
}
// Redirect relocation to the dynimport.
r.SetSym(ds)
continue
}
tplt := ctxt.loader.SymPlt(targ)
if tplt == loadpe.CreateImportStubPltToken {
// Consistency check: don't want to see both PLT and GOT tokens.
if tgot != -1 {
return fmt.Errorf("internal error in windynrelocsym: invalid GOT setting %d for reloc to %s", tgot, ctxt.loader.SymName(targ))
}
// make dynimport JMP table for PE object files.
tplt := int32(rel.Size())
ctxt.loader.SetPlt(targ, tplt)
if su == nil {
su = ctxt.loader.MakeSymbolUpdater(s)
}
r.SetSym(rel.Sym())
r.SetAdd(int64(tplt))
// jmp *addr
switch ctxt.Arch.Family {
default:
return fmt.Errorf("internal error in windynrelocsym: unsupported arch %v", ctxt.Arch.Family)
case sys.I386:
rel.AddUint8(0xff)View on GitHub (pinned to b6b368adc5)
Solutions
- Report as a Go linker internal bug at https://github.com/golang/go/issues
- Clean rebuild: go clean -cache && go build
- Try -linkmode=external as a workaround
- Identify the Go version that introduced the issue by testing with older releases
- Simplify CGO dependencies to find the triggering import pattern
Defensive patterns
Strategy: fallback
Try / catch
// Suggest external linker for internal PE relocation errors
if err := windynrelocsym(ctxt, s, r, ri); err != nil {
if strings.Contains(err.Error(), "internal error") {
return fmt.Errorf("%w (workaround: -linkmode=external)", err)
}
return err
} Prevention
- No user-side prevention for internal linker consistency errors
- Use -linkmode=external as an immediate workaround
- Report the full build configuration to the Go project for investigation
- Reduce CGO dependencies to isolate the triggering import pattern
When it happens
Trigger: ctxt.loader.SymPlt(targ) returns CreateImportStubPltToken. The code then checks tgot != -1. If the GOT was also set (not -1), the error fires with the GOT value and symbol name, since the relocation cannot simultaneously use both PLT and GOT import mechanisms.
Common situations: A bug in the PE import setup that assigns both PLT and GOT tokens to the same symbol; corrupted or inconsistent loader state during concurrent linking; regression in import handling code after a Go toolchain update.
Related errors
- internal error in windynrelocsym: redirect GOT token applied
- internal error in windynrelocsym: underlying sym for %q has
- internal error in windynrelocsym: unsupported arch %v
- dynamic relocation to unreachable symbol %s
- cannot find .data
AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12).
Data as JSON: /api/errors/44b43f76846de19c.
Report an issue: GitHub.