{"record":{"id":"591c6da8db44a450","repo":"golang/go","slug":"text-section-not-found-591c6d","errorCode":null,"errorMessage":"text section not found","messagePattern":"text section not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/internal/objfile/plan9obj.go","lineNumber":90,"sourceCode":"}\n\nfunc (f *plan9File) pcln() (textStart uint64, pclntab []byte, err error) {\n\ttextStart = f.plan9.LoadAddress + f.plan9.HdrSize\n\tif pclntab, err = loadPlan9Table(f.plan9, \"runtime.pclntab\", \"runtime.epclntab\"); err != nil {\n\t\t// We didn't find the symbols, so look for the names used in 1.3 and earlier.\n\t\t// TODO: Remove code looking for the old symbols when we no longer care about 1.3.\n\t\tvar err2 error\n\t\tif pclntab, err2 = loadPlan9Table(f.plan9, \"pclntab\", \"epclntab\"); err2 != nil {\n\t\t\treturn 0, nil, err\n\t\t}\n\t}\n\treturn textStart, pclntab, nil\n}\n\nfunc (f *plan9File) text() (textStart uint64, text []byte, err error) {\n\tsect := f.plan9.Section(\"text\")\n\tif sect == nil {\n\t\treturn 0, nil, fmt.Errorf(\"text section not found\")\n\t}\n\ttextStart = f.plan9.LoadAddress + f.plan9.HdrSize\n\ttext, err = sect.Data()\n\treturn\n}\n\nfunc findPlan9Symbol(f *plan9obj.File, name string) (*plan9obj.Sym, error) {\n\tsyms, err := f.Symbols()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, s := range syms {\n\t\tif s.Name != name {\n\t\t\tcontinue\n\t\t}\n\t\treturn &s, nil\n\t}\n\treturn nil, fmt.Errorf(\"no %s symbol found\", name)","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/internal/objfile/plan9obj.go#L72-L108","documentation":"plan9File.text() fetches the 'text' section from a Plan 9 a.out object to extract executable code. If f.plan9.Section(\"text\") returns nil, the object has no text segment and disassembly/extraction cannot proceed. This is hit by tools that read Plan 9 Go binaries (rare outside Plan 9 / 9front builds).","triggerScenarios":"Calling text() on a plan9File whose underlying plan9obj.File has no section named 'text' — e.g. a relocatable object, a data-only file, or a non-Plan-9 file misdetected as Plan 9.","commonSituations":"Cross-target confusion (running a Plan-9-targeted tool on a non-Plan-9 object), a stripped or partially-linked object, or file corruption.","solutions":["Confirm the file is a Plan 9 executable produced for GOOS=plan9.","Rebuild the Plan 9 binary.","Make sure the objfile format detector selected the correct backend."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// textStart, text, err := pf.text()\n// if err != nil {\n//     if strings.Contains(err.Error(), \"text section not found\") {\n//         // not an executable Plan 9 binary; nothing to disassemble\n//     }\n//     return err\n// }","preventionTips":["Confirm GOOS=plan9 for the binary before Plan 9 tooling.","Use fully-linked executables, not intermediate .o objects.","Verify file integrity with Plan 9 tooling."],"tags":["plan9","binary","objfile","section"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}