Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/bpf2go: strip DWARF info #481

Merged
merged 4 commits into from
Nov 16, 2021
Merged

cmd/bpf2go: strip DWARF info #481

merged 4 commits into from
Nov 16, 2021

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Nov 10, 2021

The compiled ELF contain DWARF debug info, which isn't used by the
BPF toolchain. Strip the debug info by default. Passing -strip=""
disables stripping.

Fixes #429

cmd/bpf2go/main.go Outdated Show resolved Hide resolved
@lmb lmb force-pushed the lmb/bpf2go-strip branch 2 times, most recently from d7f86fb to a5cc12a Compare November 16, 2021 09:51
Copy link
Collaborator

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good! Also looked into a way to get clang to do this automatically, but doesn't seem to be possible since we're not invoking the linker.

The compiled ELF contain DWARF debug info, which isn't used by the
BPF toolchain. Strip the debug info by default. Passing -no-strip
disables stripping.

Fixes #429
Move the example into a separate package and rename it to test. Now
that we have examples in the project root it's not a great resource
anymore. We still need it to make sure we don't regress on the
generate API however.
Also strip dwarf info from precompiled testdata.
@lmb lmb merged commit 89c6acb into master Nov 16, 2021
@lmb lmb deleted the lmb/bpf2go-strip branch November 16, 2021 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bpf2go: strip dwarf debug symbols from ELF
3 participants