coreboot/payloads/libpayload/arch/arm
Julius Werner 37513297d3 libpayload: Use Kconfig for architecture memcpy, not weak symbols
Our mechanism to override the default (pure C) memory function
implementations (memset, memcpy, memmove) with architecture-specific
optimized assembly versions doesn't actually work: it turns out that
weak functions don't work as you'd naively expect when you pack them
together with a strong definition from a different object into a static
library. When a linker tries to resolve a symbol from a static library,
it just picks the first one it finds, even if it is weak. It doesn't
evaluate all objects in the library to see if there are other strong
definitions.

To fix this, this patch gets rid of the weak symbols and uses Kconfigs
instead. It adds an optimized memmove() implementation for x86 because
that makes things easier (then all architectures either override all
three functions or none of them). Also remove memcmp() from the
functions that can be overridden for now because nobody ever needed that
anyway.

Change-Id: Iedf9898247f1999e56fde3233fad8b7cb36b1269
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87766
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-05-22 19:27:24 +00:00
..
asmlib.h arm: Update mem* functions to newer versions 2014-09-22 18:47:42 +02:00
cache.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
coreboot.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
cpu.S payloads/libpayload/arch/arm/cpu.S: Remove whitespaces before tab 2020-07-25 01:25:00 +00:00
eabi_compat.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
exception.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
exception_asm.S treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
gdb.c libpayload: gdb: Factor out gdb_handle_reentrant_exception() from arm32 2018-10-12 20:17:40 +00:00
head.S libpayload: Fix the stack and data labels 2023-12-01 02:20:29 +00:00
Kconfig libpayload: Use Kconfig for architecture memcpy, not weak symbols 2025-05-22 19:27:24 +00:00
libpayload.ldscript libpayload: Fix the stack and data labels 2023-12-01 02:20:29 +00:00
main.c libpayload/arch/x86: Update API handling of CBTABLE handoff 2023-05-24 11:49:51 +00:00
Makefile.mk libpayload: Unify selfboot() implementations 2025-02-11 20:59:57 +00:00
memcpy.S arm: Put assembly functions into separate sections 2014-11-13 06:49:41 +01:00
memmove.S arm: Put assembly functions into separate sections 2014-11-13 06:49:41 +01:00
memset.S arm: Put assembly functions into separate sections 2014-11-13 06:49:41 +01:00
sysinfo.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
timer.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
util.S treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
virtual.c libpayload: Use unsigned integer for PDG_MASK 2024-08-27 00:29:12 +00:00