{"record":{"id":"b3ea5226f6832ddb","repo":"golang/go","slug":"internal-error-preexisting-comdat-definition-for","errorCode":null,"errorMessage":"internal error: preexisting COMDAT definition for %q","messagePattern":"internal error: preexisting COMDAT definition for %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/link/internal/loadpe/ldpe.go","lineNumber":576,"sourceCode":"\t\t}\n\n\t\tbld = makeUpdater(l, bld, s)\n\t\tsectsym := state.sectsyms[sect]\n\t\tbld.SetType(l.SymType(sectsym))\n\t\tl.AddInteriorSym(sectsym, s)\n\t\tbld.SetValue(int64(pesym.Value))\n\t\tbld.SetSize(4)\n\t\tif l.SymType(sectsym).IsText() {\n\t\t\tif bld.External() && !bld.DuplicateOK() {\n\t\t\t\treturn nil, fmt.Errorf(\"%s: duplicate symbol definition\", l.SymName(s))\n\t\t\t}\n\t\t\tbld.SetExternal(true)\n\t\t}\n\t\tif sz, ok := state.comdats[uint16(pesym.SectionNumber-1)]; ok {\n\t\t\t// This is a COMDAT definition. Record that we're picking\n\t\t\t// this instance so that we can ignore future defs.\n\t\t\tif _, ok := comdatDefinitions[l.SymName(s)]; ok {\n\t\t\t\treturn nil, fmt.Errorf(\"internal error: preexisting COMDAT definition for %q\", name)\n\t\t\t}\n\t\t\tcomdatDefinitions[l.SymName(s)] = sz\n\t\t}\n\t}\n\n\t// Sort outer lists by address, adding to textp.\n\t// This keeps textp in increasing address order.\n\tfor _, sect := range f.Sections {\n\t\ts := state.sectsyms[sect]\n\t\tif s == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tl.SortSub(s)\n\t\timportSymsState.secSyms = append(importSymsState.secSyms, s)\n\t\tif l.SymType(s).IsText() {\n\t\t\tfor ; s != 0; s = l.SubSym(s) {\n\t\t\t\tif l.AttrOnList(s) {\n\t\t\t\t\treturn nil, fmt.Errorf(\"symbol %s listed multiple times\", l.SymName(s))","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/link/internal/loadpe/ldpe.go#L558-L594","documentation":"Error \"internal error: preexisting COMDAT definition for %q\" thrown in golang/go.","triggerScenarios":"Thrown at src/cmd/link/internal/loadpe/ldpe.go:576 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}