From a01cb867ce2cdff0c0ed658703c7be9fa2bf544f Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Sat, 13 Nov 2021 14:06:26 +0100 Subject: [PATCH] esp32c3_rom.ld: Add some of the string.h functions to the linker script. These functions are strongly declared and thus will be used instead of any other implementation. Furthermore, necessary Kconfig options are selected to avoid building those function from NuttX's C library. Signed-off-by: Abdelatif Guettouche --- arch/risc-v/Kconfig | 16 ++++++++++++---- .../esp32c3-devkit/scripts/esp32c3_rom.ld | 5 ++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/arch/risc-v/Kconfig b/arch/risc-v/Kconfig index 1c6123b91f5..fda26abfcdb 100644 --- a/arch/risc-v/Kconfig +++ b/arch/risc-v/Kconfig @@ -46,11 +46,19 @@ config ARCH_CHIP_ESP32C3 select ARCH_VECNOTIRQ select ARCH_HAVE_RESET select LIBC_ARCH_ATOMIC - select LIBC_ARCH_MEMCHR - select LIBC_ARCH_MEMCMP - select LIBC_ARCH_MEMCCMP - select LIBC_ARCH_MEMMOVE select LIBC_ARCH_MEMSET + select LIBC_ARCH_MEMCPY + select LIBC_ARCH_MEMMOVE + select LIBC_ARCH_MEMCMP + select LIBC_ARCH_MEMCHR + select LIBC_ARCH_MEMCCMP + select LIBC_ARCH_STRCPY + select LIBC_ARCH_STRCHR + select LIBC_ARCH_STRCMP + select LIBC_ARCH_STRLCPY + select LIBC_ARCH_STRNCPY + select LIBC_ARCH_STRLEN + select LIBC_ARCH_STRNLEN select ARCH_HAVE_TEXT_HEAP select ARCH_HAVE_BOOTLOADER ---help--- diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/esp32c3_rom.ld b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/esp32c3_rom.ld index a0110386042..29506320fc3 100644 --- a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/esp32c3_rom.ld +++ b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/esp32c3_rom.ld @@ -1936,17 +1936,20 @@ rom_pll_vol_cal = 0x40001b28; memset = 0x40000354; memcpy = 0x40000358; +memccpy = 0x400003c4; memmove = 0x4000035c; memcmp = 0x40000360; -memccpy = 0x400003c4; memchr = 0x400003c8; memrchr = 0x400003cc; strcpy = 0x40000364; strncpy = 0x40000368; +strlcpy = 0x400003f0; strcmp = 0x4000036c; strncmp = 0x40000370; strlen = 0x40000374; +strnlen = 0x40000404; strstr = 0x40000378; +strchr = 0x400003e0; bzero = 0x4000037c; /***************************************