golang/go · error

no %s symbol found

Error message

no %s symbol found

What it means

findXCOFFSymbol iterates the XCOFF symbol table for an exact Name match. If no symbol matches, the requested name is absent — typically used to locate runtime.pclntab/runtime.epclntab needed for function metadata.

Source

Thrown at src/cmd/internal/objfile/xcoff.go:123

	textStart = sect.VirtualAddress
	text, err = sect.Data()
	return
}

func findXCOFFSymbol(f *xcoff.File, name string) (*xcoff.Symbol, error) {
	for _, s := range f.Symbols {
		if s.Name != name {
			continue
		}
		if s.SectionNumber <= 0 {
			return nil, fmt.Errorf("symbol %s: invalid section number %d", name, s.SectionNumber)
		}
		if len(f.Sections) < s.SectionNumber {
			return nil, fmt.Errorf("symbol %s: section number %d is larger than max %d", name, s.SectionNumber, len(f.Sections))
		}
		return s, nil
	}
	return nil, fmt.Errorf("no %s symbol found", name)
}

func loadXCOFFTable(f *xcoff.File, sname, ename string) ([]byte, error) {
	ssym, err := findXCOFFSymbol(f, sname)
	if err != nil {
		return nil, err
	}
	esym, err := findXCOFFSymbol(f, ename)
	if err != nil {
		return nil, err
	}
	if ssym.SectionNumber != esym.SectionNumber {
		return nil, fmt.Errorf("%s and %s symbols must be in the same section", sname, ename)
	}
	sect := f.Sections[ssym.SectionNumber-1]
	data, err := sect.Data()
	if err != nil {
		return nil, err

View on GitHub (pinned to b6b368adc5)

Solutions

  1. Rebuild the AIX binary without stripping pclntab symbols.
  2. Confirm the binary is a Go-produced XCOFF executable.
  3. Use the symbol names appropriate to the binary's Go version.
Defensive patterns

Strategy: try-catch

Try / catch

// s, err := findXCOFFSymbol(f, name)
// if err != nil {
//     // 'no <name> symbol found' -> stripped or wrong binary
//     return nil, err
// }

Prevention

When it happens

Trigger: Calling findXCOFFSymbol with a name that does not appear in f.Symbols.

Common situations: An XCOFF Go binary stripped of its pclntab symbols, a non-Go XCOFF binary, or the wrong symbol name for the binary's Go version.

Related errors


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