ANDROID: KVM: arm64: Include .note.gnu.property in .hyp.rodata
Since .hyp.rodata sections of pKVM modules are emitted with SHT_MERGE, ld.ldd feels free to attempt merging it with other sections. Unfortunately, the pKVM module linker script doesn't always place them in output sections, hence causing link failures: ld.lld: error: drivers/misc/pkvm-pl011/hyp/kvm_nvhe.tmp.o:(.hyp.rodata): offset is outside the section In practice, ld.ldd only seems to attempt merging .note.gnu.property with .hyp.rodata. To work around the problem, make sure to explicitely place the .note.gnu.property in .hyp.rodata from the start, hence preventing ld.ldd from trying to optimize further. A preferable solution would be to teach ld.lld that merging pKVM modules sections is a bad idea, or to make sure the sections are not emitted with SHT_MERGE to begin with, but we couldn't find an obvious way to make that happen. This workaround is nothing more than a pratical compromise. Bug: 278749606 Bug: 244543039 Reported-by:Will Deacon <will@kernel.org> Suggested-by:
Will Deacon <will@kernel.org> Change-Id: Iae902bdfd21915f552e218515cd77881a95fef2d Signed-off-by:
Quentin Perret <qperret@google.com>
Loading
Please sign in to comment