Commit c430e9d
loader: Fix ELF relocation logic for Linux v6.17+ startup code layout (#2298)
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.
Co-authored-by: Naman Jain <namjain@microsoft.com>
Co-authored-by: GitHub Copilot <copilot@microsoft.com>1 parent 0016dfb commit c430e9d
1 file changed
+23
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
139 | 159 | | |
140 | 160 | | |
141 | 161 | | |
| |||
155 | 175 | | |
156 | 176 | | |
157 | 177 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 178 | | |
163 | 179 | | |
164 | 180 | | |
| |||
0 commit comments