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

pkg/symbol/elfutils: Fix handling of stripped Go binaries #2066

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

brancz
Copy link
Member

@brancz brancz commented Nov 9, 2022

Go binaries that are stripped, for example built with:

go build -ldflags "-w -s" main.go

Have an empty symbol table section, which some additional build steps may strip, since it's empty.

Before this patch, those Go binaries would run into an error case when attempting to load the symbol table.

Since the only truly necessary section for symbolization is the .gopclntab section, this patch proposes to only check for this section.

@brancz brancz requested a review from a team as a code owner November 9, 2022 18:48
Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

LGTM

@kakkoyun kakkoyun enabled auto-merge (squash) November 9, 2022 19:50
@brancz brancz force-pushed the fix-stripped-go-binaries branch 2 times, most recently from fe53c78 to 0b6cb75 Compare November 9, 2022 20:17
Go binaries that are stripped, for example built with:

```
go build -ldflags "-w -s" main.go
```

Have an empty symbol table section, which some additional build steps
may strip, since it's empty.

Before this patch, those Go binaries would run into an error case when
attempting to load the symbol table.

Since the only truly necessary section for symbolization is the
`.gopclntab` section, this patch proposes to only check for this
section.
@kakkoyun kakkoyun merged commit 0fc2df6 into main Nov 9, 2022
@maxbrunet maxbrunet deleted the fix-stripped-go-binaries branch May 17, 2023 21:00
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.

None yet

2 participants