On Wed, 2024-12-18 at 13:23 -0800, Josh Poimboeuf wrote: > > The linker script does place it in .data, but objtool runs on the object > file before linking, where it's still in an executable section > (.text..relocate_kernel). > > How about something like below? > > - move text to .data..relocate_kernel > - remove objtool annotations > - replace the alternative with a runtime check That leaves me unable to use 'objdump -S arch/x86/kernel/relocate_kernel_64.o' so I hate it :) At the moment objtool is *mostly* happy with the code in here; is there no way to make it happy even with the CFI annotation? In practice I probably don't even need to use SYM_TYPED_FUNC_START() anyway, as it's doing the wrong thing. It's pointless if it just uses the external __cfi_typeid_relocate_kernel symbol that the C code emits, because that's obviously going to match the prototype that the C code expects. So I might emit the __cfi_relocate_kernel prologue entirely manually, and then maybe objtool will thinking it's entitled to opinions :)
<<attachment: smime.p7s>>