Page MenuHomeFreeBSD

D46417.id142369.diff
No OneTemporary

D46417.id142369.diff

diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc
--- a/lib/libc/aarch64/string/Makefile.inc
+++ b/lib/libc/aarch64/string/Makefile.inc
@@ -10,16 +10,16 @@
memmove \
memrchr \
memset \
- stpcpy \
strchr \
strchrnul \
strcmp \
strcpy \
- strlen \
strncmp \
strnlen \
strrchr
+MDSRCS+= strcat.S
+
#
# Add the above functions. Generate an asm file that includes the needed
# Arm Optimized Routines file defining the function name to the libc name.
diff --git a/lib/libc/aarch64/string/strcat.S b/lib/libc/aarch64/string/strcat.S
new file mode 100644
--- /dev/null
+++ b/lib/libc/aarch64/string/strcat.S
@@ -0,0 +1,29 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2024 Getz Mikalsen <getz@FreeBSD.org>
+*/
+
+#include <machine/asm.h>
+
+ .weak strcat
+ .set strcat, __strcat
+ .text
+
+ENTRY(__strcat)
+ stp x29, x30, [sp, #-16]!
+ str x19, [sp, #-16]! // store preserved registers
+
+ mov x19, x0 // stash dest for later
+ bl strlen // strlen(dest)
+
+ add x0, x19, x0 // dest + (strlen(dest))
+ bl stpcpy // stpcpy(dest + strlen(dest), src)
+
+ mov x0, x19 // return dest
+
+ ldr x19, [sp], #16 // load preserved registers
+ ldp x29, x30, [sp], #16
+ ret
+
+END(__strcat)

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 22, 1:46 PM (12 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27850122
Default Alt Text
D46417.id142369.diff (1 KB)

Event Timeline