summaryrefslogtreecommitdiff
path: root/libc/string
diff options
context:
space:
mode:
Diffstat (limited to 'libc/string')
-rw-r--r--libc/string/arm/bcopy.S11
-rw-r--r--libc/string/arm/bzero.S2
-rw-r--r--libc/string/arm/memcmp.S10
-rw-r--r--libc/string/arm/memcpy.S11
-rw-r--r--libc/string/arm/memmove.S11
-rw-r--r--libc/string/arm/memset.S11
-rw-r--r--libc/string/arm/strcmp.S10
-rw-r--r--libc/string/arm/strlen.S11
-rw-r--r--libc/string/arm/strncmp.S11
9 files changed, 62 insertions, 26 deletions
diff --git a/libc/string/arm/bcopy.S b/libc/string/arm/bcopy.S
index 9e3efc7d0..a02807527 100644
--- a/libc/string/arm/bcopy.S
+++ b/libc/string/arm/bcopy.S
@@ -39,14 +39,19 @@
/* bcopy = memcpy/memmove with arguments reversed. */
-.text
.global bcopy
-.type bcopy,%function
+.set bcopy,__bcopy
+.text
+.global __bcopy
+.hidden __bcopy
+.type __bcopy,%function
.align 4
-bcopy:
+__bcopy:
/* switch the source and destination registers */
eor r0, r1, r0
eor r1, r0, r1
eor r0, r1, r0
b _memcpy (PLT)
+
+.size __bcopy,.-__bcopy
diff --git a/libc/string/arm/bzero.S b/libc/string/arm/bzero.S
index 0e96ba076..93582f7c8 100644
--- a/libc/string/arm/bzero.S
+++ b/libc/string/arm/bzero.S
@@ -47,4 +47,6 @@ __bzero:
mov r1, #0
b memset (PLT)
+.size __bzero,.-__bzero
+
.weak bzero ; bzero = __bzero
diff --git a/libc/string/arm/memcmp.S b/libc/string/arm/memcmp.S
index 6f7a064bd..bdb5aca18 100644
--- a/libc/string/arm/memcmp.S
+++ b/libc/string/arm/memcmp.S
@@ -30,12 +30,15 @@
*/
-.text
.global memcmp
-.type memcmp,%function
+.set memcmp,__memcmp
+.text
+.global __memcmp
+.hidden __memcmp
+.type __memcmp,%function
.align 4
-memcmp:
+__memcmp:
/* if ((len - 1) < 0) return 0 */
subs r2, r2, #1
movmi r0, #0
@@ -52,4 +55,5 @@ memcmp:
sub r0, r2, r3
mov pc, lr
+.size __memcmp,.-__memcmp
.weak bcmp ; bcmp = memcmp
diff --git a/libc/string/arm/memcpy.S b/libc/string/arm/memcpy.S
index 4869007d3..372da4c49 100644
--- a/libc/string/arm/memcpy.S
+++ b/libc/string/arm/memcpy.S
@@ -37,12 +37,17 @@
* by Erik Andersen <andersen@codepoet.org>
*/
-.text
.global memcpy
-.type memcpy,%function
+.set memcpy,__memcpy
+.text
+.global __memcpy
+.hidden __memcpy
+.type __memcpy,%function
.align 4
-memcpy:
+__memcpy:
stmfd sp!, {r0, lr}
bl _memcpy (PLT)
ldmfd sp!, {r0, pc}
+
+.size __memcpy,.-__memcpy
diff --git a/libc/string/arm/memmove.S b/libc/string/arm/memmove.S
index 9dbd3a004..eafd345b4 100644
--- a/libc/string/arm/memmove.S
+++ b/libc/string/arm/memmove.S
@@ -37,12 +37,17 @@
* by Erik Andersen <andersen@codepoet.org>
*/
-.text
.global memmove
-.type memmove,%function
+.set memmove,__memmove
+.text
+.global __memmove
+.hidden __memmove
+.type __memmove,%function
.align 4
-memmove:
+__memmove:
stmfd sp!, {r0, lr}
bl _memcpy (PLT)
ldmfd sp!, {r0, pc}
+
+.size __memmove,.-__memmove
diff --git a/libc/string/arm/memset.S b/libc/string/arm/memset.S
index 097c5b92a..5fca03a13 100644
--- a/libc/string/arm/memset.S
+++ b/libc/string/arm/memset.S
@@ -19,12 +19,15 @@
#include <sys/syscall.h>
-.text
.global memset
-.type memset,%function
+.set memset,__memset
+.text
+.global __memset
+.hidden __memset
+.type __memset,%function
.align 4
-memset:
+__memset:
mov a4, a1
cmp a3, $8 @ at least 8 bytes to do?
blt 2f
@@ -68,4 +71,4 @@ memset:
strb a2, [a4], $1
mov pc, lr
-.size memset,.-memset
+.size __memset,.-__memset
diff --git a/libc/string/arm/strcmp.S b/libc/string/arm/strcmp.S
index 1f486546c..e572cbe68 100644
--- a/libc/string/arm/strcmp.S
+++ b/libc/string/arm/strcmp.S
@@ -29,12 +29,15 @@
* by Erik Andersen <andersen@codepoet.org>
*/
-.text
.global strcmp
-.type strcmp,%function
+.set strcmp,__strcmp
+.text
+.global __strcmp
+.hidden __strcmp
+.type __strcmp,%function
.align 4
-strcmp:
+__strcmp:
1:
ldrb r2, [r0], #1
ldrb r3, [r1], #1
@@ -44,4 +47,5 @@ strcmp:
sub r0, r2, r3
mov pc, lr
+.size __strcmp,.-__strcmp
.weak strcoll ; strcoll = strcmp
diff --git a/libc/string/arm/strlen.S b/libc/string/arm/strlen.S
index 195276e30..7d91fd033 100644
--- a/libc/string/arm/strlen.S
+++ b/libc/string/arm/strlen.S
@@ -25,12 +25,15 @@
* exit: r0 = len
*/
-.text
.global strlen
-.type strlen,%function
+.set strlen,__strlen
+.text
+.global __strlen
+.hidden __strlen
+.type __strlen,%function
.align 4
-strlen:
+__strlen:
bic r1, r0, $3 @ addr of word containing first byte
ldr r2, [r1], $4 @ get the first word
ands r3, r0, $3 @ how many bytes are duff?
@@ -76,4 +79,4 @@ Llastword: @ drop through to here once we find a
#endif
mov pc,lr
-.size strlen,.-strlen
+.size __strlen,.-__strlen
diff --git a/libc/string/arm/strncmp.S b/libc/string/arm/strncmp.S
index 46f5f5092..94e93f7df 100644
--- a/libc/string/arm/strncmp.S
+++ b/libc/string/arm/strncmp.S
@@ -29,12 +29,15 @@
* by Erik Andersen <andersen@codepoet.org>
*/
-.text
.global strncmp
-.type strncmp,%function
+.set strncmp,__strncmp
+.text
+.global __strncmp
+.hidden __strncmp
+.type __strncmp,%function
.align 4
-strncmp:
+__strncmp:
/* if (len == 0) return 0 */
cmp r2, #0
moveq r0, #0
@@ -52,3 +55,5 @@ strncmp:
beq 1b
sub r0, r2, r3
mov pc, lr
+
+.size __strncmp,.-__strncmp