{"record":{"id":"a5926a0b18707e25","repo":"go-delve/delve","slug":"could-not-find-symbol-in-executable-sections-of-bi","errorCode":null,"errorMessage":"could not find symbol in executable sections of binary","messagePattern":"could not find symbol in executable sections of binary","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/internal/ebpf/helpers.go","lineNumber":635,"sourceCode":"\tfor i := range f.Sections {\n\t\tif f.Sections[i].Flags == elf.SHF_ALLOC+elf.SHF_EXECINSTR {\n\t\t\tsectionsToSearchForSymbol = append(sectionsToSearchForSymbol, f.Sections[i])\n\t\t}\n\t}\n\n\tvar executableSection *elf.Section\n\n\t// Find what section the symbol is in by checking the executable section's\n\t// addr space.\n\tfor m := range sectionsToSearchForSymbol {\n\t\tif addr >= sectionsToSearchForSymbol[m].Addr &&\n\t\t\taddr < sectionsToSearchForSymbol[m].Addr+sectionsToSearchForSymbol[m].Size {\n\t\t\texecutableSection = sectionsToSearchForSymbol[m]\n\t\t}\n\t}\n\n\tif executableSection == nil {\n\t\treturn 0, errors.New(\"could not find symbol in executable sections of binary\")\n\t}\n\n\treturn uint64(addr - executableSection.Addr + executableSection.Offset), nil\n}\n","sourceCodeStart":617,"sourceCodeEnd":640,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/internal/ebpf/helpers.go#L617-L640","documentation":"AddressToOffset converts a virtual address into the file offset required by uprobes by finding the executable section (PT_LOAD +X segment) containing the address. If no executable section covers the address, the symbol cannot be placed in a uprobe, so this error is returned.","triggerScenarios":"Calling AddressToOffset with a function address that does not fall within any executable section of the binary — e.g. address resolved in a data section, PLT/GOT stub, dynamically generated code, or a binary whose section table does not match loaded segments.","commonSituations":"Tracing functions in shared libraries or JIT-generated code whose sections were not included in the section list; tracing a symbol in a stripped/misaligned binary; passing an address from a different binary than the one probed; UPX-packed or otherwise obfuscated executables.","solutions":["Verify the traced function belongs to the main executable's text section (check with 'nm'/'objdump -d')","Trace a function in the executable that Delve attached the uprobe to, not one in a shared library or JIT code","Rebuild the binary with symbols and standard sections (avoid packing/obfuscation)","Confirm the correct binary path was used when initializing the eBPF context"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// ensure the symbol lives in the executable's text section before tracing:\nout, _ := exec.Command(\"nm\", binary).Output()\nif !bytes.Contains(out, []byte(\" T main.foo\")) {\n    return errors.New(\"symbol not in executable text section; cannot uprobe\")\n}","typeGuard":null,"tryCatchPattern":"off, err := ebpf.AddressToOffset(sections, addr)\nif err != nil {\n    if strings.Contains(err.Error(), \"could not find symbol in executable sections\") {\n        log.Printf(\"%v: addr may be in a shared lib or JIT code\", err)\n    }\n}","preventionTips":["Only trace functions in the main executable's text section","Avoid packed/obfuscated binaries for eBPF tracing","Confirm the binary path used for the eBPF context matches the traced process","Check symbol placement with nm/objdump before attaching uprobes"],"tags":["ebpf","uprobes","elf","address-translation"],"backgroundTag":"symbol-not-in-executable-section","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}