arm64: lds: use PROVIDE instead of conditional definitions
authorArd Biesheuvel <ardb@kernel.org>
Wed, 29 Jun 2022 08:32:46 +0000 (10:32 +0200)
committerWill Deacon <will@kernel.org>
Wed, 29 Jun 2022 09:21:23 +0000 (10:21 +0100)
commitfbf6ad5efe95665c188248b6abee94f4bf296604
tree49e5e4b44a20b1112a4458ec4fc819ca7c99650f
parent7559d9f97581654fbd0c3fa21878b6d043bbe439
arm64: lds: use PROVIDE instead of conditional definitions

Currently, a build with CONFIG_EFI=n and CONFIG_KASAN=y will not
complete successfully because of missing symbols. This is due to the
fact that the __pi_ prefixed aliases for __memcpy/__memmove were put
inside a #ifdef CONFIG_EFI block inadvertently, and are therefore
missing from the build in question.

These definitions should only be provided when needed, as they will
otherwise clutter up the symbol table, kallsyms etc for no reason.
Fortunately, instead of using CPP conditionals, we can achieve the same
result by using the linker's PROVIDE() directive, which only defines a
symbol if it is required to complete the link. So let's use that for all
symbols alias definitions.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20220629083246.3729177-1-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/image-vars.h