golang/go · error

internal error: preexisting COMDAT definition for %q

Error message

internal error: preexisting COMDAT definition for %q

What it means

Error "internal error: preexisting COMDAT definition for %q" thrown in golang/go.

Source

Thrown at src/cmd/link/internal/loadpe/ldpe.go:576

		}

		bld = makeUpdater(l, bld, s)
		sectsym := state.sectsyms[sect]
		bld.SetType(l.SymType(sectsym))
		l.AddInteriorSym(sectsym, s)
		bld.SetValue(int64(pesym.Value))
		bld.SetSize(4)
		if l.SymType(sectsym).IsText() {
			if bld.External() && !bld.DuplicateOK() {
				return nil, fmt.Errorf("%s: duplicate symbol definition", l.SymName(s))
			}
			bld.SetExternal(true)
		}
		if sz, ok := state.comdats[uint16(pesym.SectionNumber-1)]; ok {
			// This is a COMDAT definition. Record that we're picking
			// this instance so that we can ignore future defs.
			if _, ok := comdatDefinitions[l.SymName(s)]; ok {
				return nil, fmt.Errorf("internal error: preexisting COMDAT definition for %q", name)
			}
			comdatDefinitions[l.SymName(s)] = sz
		}
	}

	// Sort outer lists by address, adding to textp.
	// This keeps textp in increasing address order.
	for _, sect := range f.Sections {
		s := state.sectsyms[sect]
		if s == 0 {
			continue
		}
		l.SortSub(s)
		importSymsState.secSyms = append(importSymsState.secSyms, s)
		if l.SymType(s).IsText() {
			for ; s != 0; s = l.SubSym(s) {
				if l.AttrOnList(s) {
					return nil, fmt.Errorf("symbol %s listed multiple times", l.SymName(s))

View on GitHub (pinned to b6b368adc5)

When it happens

Trigger: Thrown at src/cmd/link/internal/loadpe/ldpe.go:576 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12). Data as JSON: /api/errors/b3ea5226f6832ddb. Report an issue: GitHub.