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> |
||
|---|---|---|
| .. | ||
| asmlib.h | ||
| cache.c | ||
| coreboot.c | ||
| cpu.S | ||
| eabi_compat.c | ||
| exception.c | ||
| exception_asm.S | ||
| gdb.c | ||
| head.S | ||
| Kconfig | ||
| libpayload.ldscript | ||
| main.c | ||
| Makefile.mk | ||
| memcpy.S | ||
| memmove.S | ||
| memset.S | ||
| sysinfo.c | ||
| timer.c | ||
| util.S | ||
| virtual.c | ||