Skip to content

Fix relocation to work on the latest Rust nightly. - #116

Merged
sunfishcode merged 1 commit into
mainfrom
sunfishcode/static-start
May 28, 2024
Merged

Fix relocation to work on the latest Rust nightly.#116
sunfishcode merged 1 commit into
mainfrom
sunfishcode/static-start

Conversation

@sunfishcode

Copy link
Copy Markdown
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 force-pushed the sunfishcode/static-start branch from 4ba17ac to b0876fd Compare May 26, 2024 02:27
@sunfishcode
sunfishcode merged commit 8a0c623 into main May 28, 2024
@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.

1 participant