[PATCH v2 2/3] riscv/purgatory: do not link with string.o and its dependencies
Conor Dooley
conor at kernel.org
Wed Jul 26 09:33:49 PDT 2023
On Wed, Jul 26, 2023 at 11:54:00AM +0200, Petr Tesarik wrote:
> From: Petr Tesarik <petr.tesarik.ext at huawei.com>
>
> Linking with this object file makes kexec_file_load(2) fail because of
> multiple unknown relocation types:
>
> - R_RISCV_ADD16, R_RISCV_SUB16: used by alternatives in strcmp()
> - R_RISCV_GOT_HI20: used to resolve _ctype in strcasecmp()
>
> All this hassle is needed for one single call to memcmp() from
> verify_sha256_digest() to compare 32 bytes of SHA256 checksum.
>
> Simply replace this memcmp() call with an explicit loop over those 32 bytes
> and remove the need to link with string.o and all the other object files
> that provide undefined symbols from that object file.
>
> Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file")
> Signed-off-by: Petr Tesarik <petr.tesarik.ext at huawei.com>
This version keeps the automation happy,
Acked-by: Conor Dooley <conor.dooley at microchip.com>
Thanks,
Conor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20230726/92ca5e29/attachment-0001.sig>
More information about the kexec
mailing list