loader: Fix ELF relocation logic for Linux v6.17+ startup code layout #2298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After Linux v6.17, the x86_64 kernel startup code moved from .head.text
to .init.text. This moves the startup code to an address, higher than
the actual physical load address. Update the loader to check the
lowest program header address for relocation, not just the entry point,
to handle both old and new kernels.
This issue was identified when latest upstream kernel is built with latest openvmm.
Compilation error:
Error: underhill kernel loader
Caused by:
0: kernel load error
1: elf loader error
2: invalid ELF program header memory offset 134217728, below start 136314880
Tested the change, for bootup, both with current mainline and latest upstream kernel.