https://github.com/polarsignals/split-debug
[Incomplete] A native Golang tool to extract DWARF and Symbol information for ELF Object files
https://github.com/polarsignals/split-debug
debug-info elf elf-binaries elf-writer golang golang-library
Last synced: 5 months ago
JSON representation
[Incomplete] A native Golang tool to extract DWARF and Symbol information for ELF Object files
- Host: GitHub
- URL: https://github.com/polarsignals/split-debug
- Owner: polarsignals
- License: apache-2.0
- Created: 2022-06-01T08:24:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-06T02:14:46.000Z (about 3 years ago)
- Last Synced: 2025-12-28T19:52:57.286Z (5 months ago)
- Topics: debug-info, elf, elf-binaries, elf-writer, golang, golang-library
- Language: Go
- Homepage:
- Size: 51.8 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](LICENSE)
[](https://github.com/polarsignals/split-debug/commits/master) 
[](https://github.com/polarsignals/split-debug/releases/latest) 
[](https://pkg.go.dev/github.com/polarsignals/split-debug?tab=subdirectories) [](https://goreportcard.com/report/github.com/polarsignals/split-debug)
# split-debug
A native Golang tool to extract DWARF and Symbol information for ELF Object files
# DISCLAIMER
> This project is in-complete.
But feel free to contribute. This project is a proof of concept for https://github.com/parca-dev/parca-agent to extract debug information from ELF files using pure Go.
It turns out a fully-fledged ELF writer written in Go doesn't exist.
- https://www.reddit.com/r/golang/comments/v1v9yp/looking_for_a_package_for_writing_elf_files/iap3fx8/?context=3
- https://twitter.com/kpolarsignals/status/1531688277740240896?s=20&t=n6T5PmNNQmvAtKWxSiwjMA
So I started to write a package for that. I'm not an expert on the format, but I'm learning. Please feel free to contribute.
## TODO
* [ ] Ensure consistency of linked sections when target removed (sh_link)
* [ ] Ensure consistency and existence of overlapping segments when a section removed (offset, range check)
* [ ] Ensure consistency and soundness of relocations (type: SHT_RELA)
* [ ] Ensure soundness of entry point (if the output ELF file is still executable)
## Configuration
Flags:
[embedmd]:# (dist/help.txt)
```txt
Usage: split-debug
Arguments:
File path to the object file extract debug information from.
Flags:
-h, --help Show context-sensitive help.
--log-level="info" Log level.
```