-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
debug/gosym: extraced entry address not met the symbol value with elf format #65232
Comments
I also test it with other binary, and I found if the cgo is enabled, the gclntab address will always diff from symbol address. |
Try passing the address of |
Do you mean |
Yes... corrected |
Can you give advice about where in the golang source code cause |
In the Go linker we put all Go functions together, after the The Go pclntab contains only relative addresses, relative to In general, the debug/gosym package is not meant to be a reverse engineering tool. If one strips the symbol table, they can also smash the Go pclntab. |
Change https://go.dev/cl/557957 mentions this issue: |
Fixes golang#65232 Change-Id: I9ef76355cec4bea2d77811a69c61c1806c486be8 GitHub-Last-Rev: 9c617b6 GitHub-Pull-Request: golang#65263 Reviewed-on: https://go-review.googlesource.com/c/go/+/557957 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
Go version
go version go1.22rc1 windows/amd64
Output of
go env
in your module/workspace:What did you do?
When using the
debug/gosym
anddebug/elf
extract the same function, it didn't produce the same address, but as elf document and gosym comment suggest, they both mean the virtual address for function at runtime, and should be the same.I write a script to reproduce the question.
I test it with the binary compiled from k8s/kubelet. You can get the file at kubelet-linux-1.21-arm64. The compile command can be found at kube.yml
What did you see happen?
2024/01/23 19:36:53 pclntabAddr 402420 != symbolAddr 402520
What did you expect to see?
The text was updated successfully, but these errors were encountered: