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 relocation to work on the latest Rust nightly. #116

Merged
merged 1 commit into from
May 28, 2024

Conversation

sunfishcode
Copy link
Owner

The trick of using a static variable initialized with an address to obtain the pre-relocated address no longer appears to work on Rust nightly, so replace it with code that reads the static start address out of the e_start field of the executable's ELF header. This is less "sneaky", so it should be more robust against compiler changes.

And, fix the 32-bit x86 relocation code and re-enable all the tests on x86.

@sunfishcode sunfishcode force-pushed the sunfishcode/static-start branch 2 times, most recently from d84b2de to 4ba17ac Compare May 25, 2024 13:28
The trick of using a static variable initialized with an address to
obtain the pre-relocated address no longer appears to work on Rust
nightly, so replace it with code that reads the static start address
out of the `e_start` field of the executable's ELF header. This is
less "sneaky", so it should be more robust against compiler changes.

And, fix the 32-bit x86 relocation code and re-enable all the tests
on x86.
@sunfishcode sunfishcode merged commit 8a0c623 into main May 28, 2024
5 checks passed
@sunfishcode sunfishcode deleted the sunfishcode/static-start branch May 28, 2024 16:05
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

1 participant