summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/arm/string
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-08-31 02:53:56 +0000
committerguenther <guenther@openbsd.org>2015-08-31 02:53:56 +0000
commit9b9d2a55a62c8e82206c25f94fcc7f4e2765250e (patch)
tree4e1fa28e81f1f4b2467c7facbde18ea61addb735 /lib/libc/arch/arm/string
parentspaces snuck in (diff)
downloadwireguard-openbsd-9b9d2a55a62c8e82206c25f94fcc7f4e2765250e.tar.xz
wireguard-openbsd-9b9d2a55a62c8e82206c25f94fcc7f4e2765250e.zip
Add framework for resolving (pun intended) libc namespace issues, using
wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
Diffstat (limited to 'lib/libc/arch/arm/string')
-rw-r--r--lib/libc/arch/arm/string/_memcpy.S5
-rw-r--r--lib/libc/arch/arm/string/bcopy.S5
-rw-r--r--lib/libc/arch/arm/string/bzero.S5
-rw-r--r--lib/libc/arch/arm/string/ffs.S5
-rw-r--r--lib/libc/arch/arm/string/memcmp.S5
-rw-r--r--lib/libc/arch/arm/string/memcpy.S5
-rw-r--r--lib/libc/arch/arm/string/memmove.S5
-rw-r--r--lib/libc/arch/arm/string/memset.S5
-rw-r--r--lib/libc/arch/arm/string/strcmp.S5
-rw-r--r--lib/libc/arch/arm/string/strncmp.S5
10 files changed, 30 insertions, 20 deletions
diff --git a/lib/libc/arch/arm/string/_memcpy.S b/lib/libc/arch/arm/string/_memcpy.S
index dee8de3e080..ef2ccc442b9 100644
--- a/lib/libc/arch/arm/string/_memcpy.S
+++ b/lib/libc/arch/arm/string/_memcpy.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: _memcpy.S,v 1.4 2015/06/08 14:22:05 jsg Exp $ */
+/* $OpenBSD: _memcpy.S,v 1.5 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: _memcpy.S,v 1.4 2003/04/05 23:08:52 bjh21 Exp $ */
/*-
@@ -30,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
/*
* This is one fun bit of code ...
@@ -462,3 +462,4 @@ ENTRY(_memcpy)
.Lmemcpy_bsrcul1l4:
add r1, r1, #1
b .Lmemcpy_bl4
+END(_memcpy)
diff --git a/lib/libc/arch/arm/string/bcopy.S b/lib/libc/arch/arm/string/bcopy.S
index 3953fef1732..f71b5ce7cbd 100644
--- a/lib/libc/arch/arm/string/bcopy.S
+++ b/lib/libc/arch/arm/string/bcopy.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcopy.S,v 1.3 2008/06/26 05:42:04 ray Exp $ */
+/* $OpenBSD: bcopy.S,v 1.4 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: bcopy.S,v 1.2 2001/07/16 05:50:06 matt Exp $ */
/*-
@@ -30,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
/* bcopy = memcpy/memmove with arguments reversed. */
@@ -40,3 +40,4 @@ ENTRY(bcopy)
eor r1, r0, r1
eor r0, r1, r0
b PIC_SYM(_C_LABEL(_memcpy), PLT)
+END_WEAK(bcopy)
diff --git a/lib/libc/arch/arm/string/bzero.S b/lib/libc/arch/arm/string/bzero.S
index 40430a86873..419e2bbdc9d 100644
--- a/lib/libc/arch/arm/string/bzero.S
+++ b/lib/libc/arch/arm/string/bzero.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: bzero.S,v 1.3 2008/06/26 05:42:04 ray Exp $ */
+/* $OpenBSD: bzero.S,v 1.4 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: bzero.S,v 1.2 2001/07/16 05:50:06 matt Exp $ */
/*-
@@ -30,9 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
ENTRY(bzero)
mov r2, r1
mov r1, #0
b PIC_SYM(_C_LABEL(memset), PLT)
+END_WEAK(bzero)
diff --git a/lib/libc/arch/arm/string/ffs.S b/lib/libc/arch/arm/string/ffs.S
index 9dd7e5aef2f..7f4b289d860 100644
--- a/lib/libc/arch/arm/string/ffs.S
+++ b/lib/libc/arch/arm/string/ffs.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs.S,v 1.3 2009/10/28 06:49:54 deraadt Exp $ */
+/* $OpenBSD: ffs.S,v 1.4 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: ffs.S,v 1.5 2003/04/05 23:08:52 bjh21 Exp $ */
/*
* Copyright (c) 2001 Christopher Gilbert
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
/*
* ffs - find first set bit, this algorithm isolates the first set
@@ -61,6 +61,7 @@ ENTRY(ffs)
ldrneb r0, [ r2, r0, lsr #26 ]
mov pc, lr
+END_WEAK(ffs)
.text;
.type .L_ffs_table, _ASM_TYPE_OBJECT;
.L_ffs_table:
diff --git a/lib/libc/arch/arm/string/memcmp.S b/lib/libc/arch/arm/string/memcmp.S
index 3a564c7338a..f7c5c966663 100644
--- a/lib/libc/arch/arm/string/memcmp.S
+++ b/lib/libc/arch/arm/string/memcmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memcmp.S,v 1.4 2009/10/28 06:49:54 deraadt Exp $ */
+/* $OpenBSD: memcmp.S,v 1.5 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: memcmp.S,v 1.2 2003/04/05 23:08:52 bjh21 Exp $ */
/*
@@ -29,7 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
ENTRY(memcmp)
/* if (len == 0) return 0 */
@@ -50,3 +50,4 @@ ENTRY(memcmp)
beq 1b
sub r0, r2, r3
mov pc, lr
+END_STRONG(memcmp)
diff --git a/lib/libc/arch/arm/string/memcpy.S b/lib/libc/arch/arm/string/memcpy.S
index 6aeb5b84bac..5797c6d6f33 100644
--- a/lib/libc/arch/arm/string/memcpy.S
+++ b/lib/libc/arch/arm/string/memcpy.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memcpy.S,v 1.4 2014/11/30 19:43:56 deraadt Exp $ */
+/* $OpenBSD: memcpy.S,v 1.5 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: memcpy.S,v 1.3 2003/04/05 23:08:52 bjh21 Exp $ */
/*-
@@ -30,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
/*
* XXX
@@ -42,3 +42,4 @@ ENTRY(memcpy)
stmfd sp!, {r0, lr}
bl PIC_SYM(_C_LABEL(_memcpy), PLT)
ldmfd sp!, {r0, pc}
+END_STRONG(memcpy)
diff --git a/lib/libc/arch/arm/string/memmove.S b/lib/libc/arch/arm/string/memmove.S
index 8244afb7de1..c2f107e3cd8 100644
--- a/lib/libc/arch/arm/string/memmove.S
+++ b/lib/libc/arch/arm/string/memmove.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memmove.S,v 1.3 2008/06/26 05:42:04 ray Exp $ */
+/* $OpenBSD: memmove.S,v 1.4 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: memmove.S,v 1.3 2003/04/05 23:08:52 bjh21 Exp $ */
/*-
@@ -30,9 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
ENTRY(memmove)
stmfd sp!, {r0, lr}
bl PIC_SYM(_C_LABEL(_memcpy), PLT)
ldmfd sp!, {r0, pc}
+END_STRONG(memmove)
diff --git a/lib/libc/arch/arm/string/memset.S b/lib/libc/arch/arm/string/memset.S
index a4c3d158938..5ab2f9f3bcd 100644
--- a/lib/libc/arch/arm/string/memset.S
+++ b/lib/libc/arch/arm/string/memset.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memset.S,v 1.3 2015/06/08 14:22:05 jsg Exp $ */
+/* $OpenBSD: memset.S,v 1.4 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: memset.S,v 1.3 2003/04/05 23:08:52 bjh21 Exp $ */
/*
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
/*
* Sets a block of memory to the specified value
@@ -127,3 +127,4 @@ ENTRY(memset)
ldmfd sp!, {r0}
mov pc, lr /* Exit */
+END_STRONG(memset)
diff --git a/lib/libc/arch/arm/string/strcmp.S b/lib/libc/arch/arm/string/strcmp.S
index ea6078e7f9c..223610d0925 100644
--- a/lib/libc/arch/arm/string/strcmp.S
+++ b/lib/libc/arch/arm/string/strcmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcmp.S,v 1.3 2005/08/07 16:40:14 espie Exp $ */
+/* $OpenBSD: strcmp.S,v 1.4 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: strcmp.S,v 1.3 2003/04/05 23:08:52 bjh21 Exp $ */
/*
@@ -29,7 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
ENTRY(strcmp)
1:
@@ -40,3 +40,4 @@ ENTRY(strcmp)
beq 1b
sub r0, r2, r3
mov pc, lr
+END_STRONG(strcmp)
diff --git a/lib/libc/arch/arm/string/strncmp.S b/lib/libc/arch/arm/string/strncmp.S
index f8960bbc84b..1014d5dc4ea 100644
--- a/lib/libc/arch/arm/string/strncmp.S
+++ b/lib/libc/arch/arm/string/strncmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: strncmp.S,v 1.4 2009/05/03 05:09:40 drahn Exp $ */
+/* $OpenBSD: strncmp.S,v 1.5 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: strncmp.S,v 1.2 2003/04/05 23:08:52 bjh21 Exp $ */
/*
@@ -29,7 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
ENTRY(strncmp)
/* if (len == 0) return 0 */
@@ -51,3 +51,4 @@ ENTRY(strncmp)
beq 1b
sub r0, r2, r3
mov pc, lr
+END_STRONG(strncmp)