{"record":{"id":"ba02e3854afd6bf5","repo":"golang/go","slug":"s-duplicate-symbol-definition","errorCode":null,"errorMessage":"%s: duplicate symbol definition","messagePattern":"(.+?): duplicate symbol definition","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/link/internal/loadpe/ldpe.go","lineNumber":568,"sourceCode":"\t\t}\n\t\tif l.OuterSym(s) != 0 {\n\t\t\tif l.AttrDuplicateOK(s) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\touterName := l.SymName(l.OuterSym(s))\n\t\t\tsectName := l.SymName(state.sectsyms[sect])\n\t\t\treturn nil, fmt.Errorf(\"%s: duplicate symbol reference: %s in both %s and %s\", pn, l.SymName(s), outerName, sectName)\n\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 {","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/link/internal/loadpe/ldpe.go#L550-L586","documentation":"Error \"%s: duplicate symbol definition\" thrown in golang/go.","triggerScenarios":"Thrown at src/cmd/link/internal/loadpe/ldpe.go:568 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}