[PATCH v5 07/20] x86/kexec: Invoke copy of relocate_kernel() instead of the original
David Woodhouse
dwmw2 at infradead.org
Wed Dec 18 14:27:27 PST 2024
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 :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5965 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20241218/80b644fa/attachment.p7s>
More information about the kexec
mailing list