RISC-V: lib: Add pi aliases for string functions
authorJesse Taube <jesse@rivosinc.com>
Tue, 9 Jul 2024 17:39:35 +0000 (13:39 -0400)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 5 Aug 2024 19:06:39 +0000 (12:06 -0700)
memset, strcmp, and strncmp are all used in the __pi_ section,
add SYM_FUNC_ALIAS for them.

When KASAN is enabled in <asm/string.h> __pi___memset is also needed.

Suggested-by: Charlie Jenkins <charlie@rivosinc.com>
Signed-off-by: Jesse Taube <jesse@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240709173937.510084-3-jesse@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/lib/memset.S
arch/riscv/lib/strcmp.S
arch/riscv/lib/strncmp.S

index 35f358e70bdb6bf79bda0f366e34c98c6ef5bbc3..da23b8347e2d15f8a0a66777afb9d4ca63290535 100644 (file)
@@ -111,3 +111,5 @@ SYM_FUNC_START(__memset)
        ret
 SYM_FUNC_END(__memset)
 SYM_FUNC_ALIAS_WEAK(memset, __memset)
+SYM_FUNC_ALIAS(__pi_memset, __memset)
+SYM_FUNC_ALIAS(__pi___memset, __memset)
index 687b2bea5c438c8157353b02eb3432d3ecec166a..bc73325b2fd1dbe54710b21d382fd05af73ead01 100644 (file)
@@ -120,3 +120,4 @@ strcmp_zbb:
 .option pop
 #endif
 SYM_FUNC_END(strcmp)
+SYM_FUNC_ALIAS(__pi_strcmp, strcmp)
index aba5b3148621d8308523affc6dee8b5d61b1f16a..b36325a57f6af8cde7db5f0b68e82acb5a23bcee 100644 (file)
@@ -136,3 +136,4 @@ strncmp_zbb:
 .option pop
 #endif
 SYM_FUNC_END(strncmp)
+SYM_FUNC_ALIAS(__pi_strncmp, strncmp)