go-delve/delve · error
could not create symbol table from %s
Error message
could not create symbol table from %s
What it means
Delve parses the Go pclntab (`.gopclntab` section) of an ELF binary to build a gosym symbol table for Go runtime-based line/function lookup. gosym.NewTable returned an error, meaning the section data is not a valid pclntab for the expected Go version format.
Source
Thrown at pkg/proc/pclntab.go:34
section := exe.Section(sectionLabel)
if section == nil {
// binary may be built with -pie
sectionLabel = ".data.rel.ro.gopclntab"
section = exe.Section(sectionLabel)
if section == nil {
return nil, 0, errors.New("could not read section .gopclntab")
}
}
tableData, err := section.Data()
if err != nil {
return nil, 0, errors.New("found section but could not read .gopclntab")
}
addr := exe.Section(".text").Addr
lineTable := gosym.NewLineTable(tableData, addr)
symTable, err := gosym.NewTable([]byte{}, lineTable)
if err != nil {
return nil, 0, fmt.Errorf("could not create symbol table from %s ", path)
}
return symTable, section.Addr, nil
}
func readPcLnTableMacho(exe *macho.File, path string) (*gosym.Table, uint64, error) {
// Default section label is __gopclntab
sectionLabel := "__gopclntab"
section := exe.Section(sectionLabel)
if section == nil {
return nil, 0, errors.New("could not read section __gopclntab")
}
tableData, err := section.Data()
if err != nil {
return nil, 0, errors.New("found section but could not read __gopclntab")
}
addr := exe.Section("__text").AddrView on GitHub (pinned to a23773e6c3)
Solutions
- Rebuild the target binary with a recent Go toolchain (go build without stripping flags)
- Do not strip the binary: remove -ldflags "-s -w" or any section-stripping step
- Update Delve to the latest version so gosym supports the target's pclntab format
- Verify the binary isn't corrupted (re-download, check checksum)
Example fix
// before go build -ldflags="-s -w" -o app . // after go build -o app .
Defensive patterns
Strategy: validation
Validate before calling
data := elfSection(exe, ".gopclntab"); if data == nil || len(data) < 8 { return errors.New("missing or empty .gopclntab") }; magic := binary.LittleEndian.Uint32(data); if !validPclntabMagic(magic) { return errors.New("unsupported pclntab format") } Prevention
- Never ship stripped (-s -w) binaries you intend to debug
- Keep Delve updated alongside your Go toolchain
- Verify the target is a real Go binary before Go-runtime symbol loading
- Checksum binaries before use to rule out corruption
When it happens
Trigger: Calling loadBinaryInfoGoRuntimeElf on an ELF binary whose .gopclntab is missing, truncated, or built with a Go version whose pclntab magic/format gosym cannot parse (e.g. stripped or corrupted binary).
Common situations: Debugging a binary from a Go version newer than the Go version Delve was compiled with; a binary that has been aggressively stripped or modified; a non-Go binary that happens to have a .gopclntab-like section; corrupted download/copy of the executable.
Related errors
- unsupported machine type
- could not read section .gopclntab
- found section but could not read .gopclntab
- could not read debug info (%v) and could not read go symbol
- error loading binary info from Go runtime: %v
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/cea756bf75ce20fd.
Report an issue: GitHub.