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

fix: amd64, offset read error issue for PIE executable. PR #516 #517

Merged
merged 2 commits into from Apr 12, 2024

Conversation

cfc4n
Copy link
Member

@cfc4n cfc4n commented Apr 10, 2024

fix PR #516

On amd64, when the executable program in PIE format compiled by golang reads the return instruction of the function, the start address of inst is incorrect, resulting in an exception, see PR #516 for details.

ref: https://github.com/golang/go/blob/bdd27c4debfb51fe42df0c0532c1c747777b7a32/src/cmd/internal/objfile/elf.go#L175

On amd64, when the executable program in PIE format compiled by golang reads the return instruction of the function, the start address of inst is incorrect, resulting in an exception, see PR #516 for details.

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
@cfc4n cfc4n added the fix bug fix PR label Apr 10, 2024
@cfc4n
Copy link
Member Author

cfc4n commented Apr 10, 2024

now, IT works.

@sancppp PTAL
image

image

@sancppp
Copy link
Contributor

sancppp commented Apr 10, 2024

LGTM.
I'm sorry I can only provide some testing and no assistance in locating and resolving this bug.

@cfc4n
Copy link
Member Author

cfc4n commented Apr 11, 2024

LGTM. I'm sorry I can only provide some testing and no assistance in locating and resolving this bug.

This is also a big contribution, thank you.

Copy link
Member Author

@cfc4n cfc4n left a comment

Choose a reason for hiding this comment

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

@wlingze PTAL

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
@cfc4n cfc4n requested review from wlingze and sancppp April 12, 2024 13:39
@cfc4n cfc4n merged commit 449c9c9 into master Apr 12, 2024
6 checks passed
@cfc4n cfc4n deleted the fix_pr516_amd64_pie_offsets branch April 12, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix bug fix PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants