summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-01-11 21:23:25 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-01-11 21:23:25 +0000
commit4a291bbe5e97409cc4d114943b143fc614fc5f0b (patch)
tree12a7df388a845a08eda5abe64d1a0cb97c69227c /lib/libc
parent0ee79688ac536baad82a4d388a767452872c2936 (diff)
Add END() directives to the various functions.
Make the code PIC-aware when necessary (i.e. invoke other functions through the PLT, and access global data through the GOT). No change for non-PIC compilation.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/arch/m88k/gen/_setjmp.S10
-rw-r--r--lib/libc/arch/m88k/gen/fabs.S3
-rw-r--r--lib/libc/arch/m88k/gen/setjmp.S17
-rw-r--r--lib/libc/arch/m88k/gen/sigsetjmp.S17
-rw-r--r--lib/libc/arch/m88k/net/htonl.S3
-rw-r--r--lib/libc/arch/m88k/net/htons.S3
-rw-r--r--lib/libc/arch/m88k/net/ntohl.S3
-rw-r--r--lib/libc/arch/m88k/net/ntohs.S3
-rw-r--r--lib/libc/arch/m88k/sys/Ovfork.S3
-rw-r--r--lib/libc/arch/m88k/sys/brk.S27
-rw-r--r--lib/libc/arch/m88k/sys/cerror.S16
-rw-r--r--lib/libc/arch/m88k/sys/exect.S5
-rw-r--r--lib/libc/arch/m88k/sys/fork.S3
-rw-r--r--lib/libc/arch/m88k/sys/sbrk.S30
-rw-r--r--lib/libc/arch/m88k/sys/sigpending.S5
-rw-r--r--lib/libc/arch/m88k/sys/sigprocmask.S5
-rw-r--r--lib/libc/arch/m88k/sys/sigreturn.S5
-rw-r--r--lib/libc/arch/m88k/sys/sigsuspend.S5
-rw-r--r--lib/libc/arch/m88k/sys/syscall.S5
-rw-r--r--lib/libc/arch/m88k/sys/tfork_thread.S5
20 files changed, 142 insertions, 31 deletions
diff --git a/lib/libc/arch/m88k/gen/_setjmp.S b/lib/libc/arch/m88k/gen/_setjmp.S
index ffa1c78846e..aef1c448517 100644
--- a/lib/libc/arch/m88k/gen/_setjmp.S
+++ b/lib/libc/arch/m88k/gen/_setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: _setjmp.S,v 1.10 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: _setjmp.S,v 1.11 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 2002 Steve Murphree, Jr.
* All rights reserved.
@@ -78,6 +78,7 @@ ENTRY(_setjmp)
st %r4,%r2,80
jmp.n %r1
or %r2,%r0,0 /* return 0 */
+END(_setjmp)
/*
void _longjmp(jmp_buf env, int val);
@@ -114,9 +115,14 @@ ENTRY(_longjmp)
2: subu %r31,%r31,16 /* get a temporary stack */
st %r1,%r31,0 /* save r1 on stack (return address) */
+#ifdef __PIC__
bsr _C_LABEL(longjmperror)
bsr _C_LABEL(abort) /* NO RETURN */
+#else
+ bsr _C_LABEL(longjmperror)#plt
+ bsr _C_LABEL(abort)#plt /* NO RETURN */
+#endif
ld %r1,%r31,0 /* restore r1 from stack */
jmp.n %r1 /* this should not happen but we are prepared */
addu %r31,%r31,16 /* restore the stack */
-
+END(_longjmp)
diff --git a/lib/libc/arch/m88k/gen/fabs.S b/lib/libc/arch/m88k/gen/fabs.S
index df9183adcbe..6ba92a9e90a 100644
--- a/lib/libc/arch/m88k/gen/fabs.S
+++ b/lib/libc/arch/m88k/gen/fabs.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fabs.S,v 1.10 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: fabs.S,v 1.11 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -44,3 +44,4 @@ ENTRY(fabs)
ld.d %r2,%r31,0
jmp.n %r1
addu %r31,%r31,16
+END(fabs)
diff --git a/lib/libc/arch/m88k/gen/setjmp.S b/lib/libc/arch/m88k/gen/setjmp.S
index 541cb8b5f4a..1d4abb12af5 100644
--- a/lib/libc/arch/m88k/gen/setjmp.S
+++ b/lib/libc/arch/m88k/gen/setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: setjmp.S,v 1.11 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: setjmp.S,v 1.12 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 2002 Steve Murphree, Jr.
* All rights reserved.
@@ -76,13 +76,18 @@ ENTRY(setjmp)
or %r4,%r0,SETJMP_SIG /* r4 now contains setjmp type */
st %r4,%r2,80 /* setjmp type to _setjmp */
or %r14,%r2,0 /* store address of env in r14 */
+#ifdef __PIC__
bsr.n _C_LABEL(sigblock) /* r2 = sigblock(0) */
+#else
+ bsr.n _C_LABEL(sigblock)#plt /* r2 = sigblock(0) */
+#endif
or %r2,%r0,0
st %r2,%r14,4 /* save signal set in offset 4 of env */
ld %r1,%r14,0
ld %r14,%r14,8
jmp.n %r1 /* return 0 */
or %r2,%r0,0
+END(setjmp)
/*
void longjmp(jmp_buf env, int retval);
@@ -114,7 +119,11 @@ ENTRY(longjmp)
subu %r31,%r31,16 /* get a temporary stack */
st.d %r2,%r31,0 /* save r2 and r3 on stack (env + return val) */
+#ifdef __PIC__
+ bsr.n _C_LABEL(sigsetmask)#plt /* restore the signal set */
+#else
bsr.n _C_LABEL(sigsetmask) /* restore the signal set */
+#endif
ld %r2,%r2,4
ld.d %r2,%r31,0 /* restore r2 and r3 */
addu %r31,%r31,16
@@ -126,8 +135,14 @@ ENTRY(longjmp)
2: subu %r31,%r31,16 /* get a temporary stack */
st %r1,%r31,0 /* save r1 on stack (return address) */
+#ifdef __PIC__
bsr _C_LABEL(longjmperror)
bsr _C_LABEL(abort) /* NO RETURN */
+#else
+ bsr _C_LABEL(longjmperror)#plt
+ bsr _C_LABEL(abort)#plt /* NO RETURN */
+#endif
ld %r1,%r31,0 /* restore r1 from stack */
jmp.n %r1 /* this should not happen but we are prepared */
addu %r31,%r31,16 /* restore the stack */
+END(longjmp)
diff --git a/lib/libc/arch/m88k/gen/sigsetjmp.S b/lib/libc/arch/m88k/gen/sigsetjmp.S
index d9bdf79324c..fba8cd3dc4d 100644
--- a/lib/libc/arch/m88k/gen/sigsetjmp.S
+++ b/lib/libc/arch/m88k/gen/sigsetjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigsetjmp.S,v 1.12 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: sigsetjmp.S,v 1.13 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 2002 Steve Murphree, Jr.
* All rights reserved.
@@ -80,7 +80,11 @@ ENTRY(sigsetjmp)
bcnd.n eq0,%r3,1f /* skip signal stuff if savemask == 0 */
st %r3,%r2,84 /* save `savemask' value */
or %r14,%r2,0 /* store address of env in r14 */
+#ifdef __PIC__
+ bsr.n _C_LABEL(sigblock)#plt /* r2 = sigblock(0) */
+#else
bsr.n _C_LABEL(sigblock) /* r2 = sigblock(0) */
+#endif
or %r2,%r0,%r0
st %r2,%r14,4 /* save signal set in offset 4 of env */
ld %r1,%r14,0
@@ -88,6 +92,7 @@ ENTRY(sigsetjmp)
1:
jmp.n %r1 /* return 0 */
or %r2,%r0,0
+END(sigsetjmp)
/*
void siglongjmp(sigjmp_buf env, int val);
@@ -121,7 +126,11 @@ ENTRY(siglongjmp)
subu %r31,%r31,16 /* get a temporary stack */
st.d %r2,%r31,0 /* save r2 and r3 on stack (env + return val) */
+#ifdef __PIC__
+ bsr.n _C_LABEL(sigsetmask)#plt /* restore the signal set */
+#else
bsr.n _C_LABEL(sigsetmask) /* restore the signal set */
+#endif
ld %r2,%r2,4
ld.d %r2,%r31,0 /* restore r2 and r3 from stack */
addu %r31,%r31,16
@@ -135,8 +144,14 @@ ENTRY(siglongjmp)
2: subu %r31,%r31,16 /* get a temporary stack */
st %r1,%r31,0 /* save r1 on stack (return address) */
+#ifdef __PIC__
bsr _C_LABEL(longjmperror)
bsr _C_LABEL(abort) /* NO RETURN */
+#else
+ bsr _C_LABEL(longjmperror)#plt
+ bsr _C_LABEL(abort)#plt /* NO RETURN */
+#endif
ld %r1,%r31,0 /* restore r1 from stack */
jmp.n %r1 /* this should not happen but we are prepared */
addu %r31,%r31,16 /* restore the stack */
+END(siglongjmp)
diff --git a/lib/libc/arch/m88k/net/htonl.S b/lib/libc/arch/m88k/net/htonl.S
index a2d2d68f2b2..be6ca8d9d3a 100644
--- a/lib/libc/arch/m88k/net/htonl.S
+++ b/lib/libc/arch/m88k/net/htonl.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: htonl.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: htonl.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,3 +39,4 @@
ENTRY(htonl)
jmp %r1
+END(htonl)
diff --git a/lib/libc/arch/m88k/net/htons.S b/lib/libc/arch/m88k/net/htons.S
index 065f9023f29..02bad3e12b2 100644
--- a/lib/libc/arch/m88k/net/htons.S
+++ b/lib/libc/arch/m88k/net/htons.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: htons.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: htons.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,3 +40,4 @@
ENTRY(htons)
jmp.n %r1
clr %r2,%r2,16<16> /* clear the top 16 bits */
+END(htons)
diff --git a/lib/libc/arch/m88k/net/ntohl.S b/lib/libc/arch/m88k/net/ntohl.S
index 565f4b2742a..0df158020bd 100644
--- a/lib/libc/arch/m88k/net/ntohl.S
+++ b/lib/libc/arch/m88k/net/ntohl.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntohl.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: ntohl.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,3 +39,4 @@
ENTRY(ntohl)
jmp %r1
+END(ntohl)
diff --git a/lib/libc/arch/m88k/net/ntohs.S b/lib/libc/arch/m88k/net/ntohs.S
index ba86f9ce228..63dd922e819 100644
--- a/lib/libc/arch/m88k/net/ntohs.S
+++ b/lib/libc/arch/m88k/net/ntohs.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntohs.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: ntohs.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,3 +40,4 @@
ENTRY(ntohs)
jmp.n %r1
clr %r2,%r2,16<16> /* clear the top 16 bits */
+END(ntohs)
diff --git a/lib/libc/arch/m88k/sys/Ovfork.S b/lib/libc/arch/m88k/sys/Ovfork.S
index c51f626640f..d2b6c3c3027 100644
--- a/lib/libc/arch/m88k/sys/Ovfork.S
+++ b/lib/libc/arch/m88k/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.8 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.9 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -43,3 +43,4 @@ SYSCALL(vfork)
or %r3,%r0,0
parent:
jmp %r1 /* pid = vfork() */
+END(vfork)
diff --git a/lib/libc/arch/m88k/sys/brk.S b/lib/libc/arch/m88k/sys/brk.S
index 59c55b18b88..7ac8f3fba72 100644
--- a/lib/libc/arch/m88k/sys/brk.S
+++ b/lib/libc/arch/m88k/sys/brk.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: brk.S,v 1.9 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: brk.S,v 1.10 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -44,8 +44,17 @@ ASGLOBAL(__minbrk)
.long _end
ENTRY(brk)
+#ifdef __PIC__
+ PIC_SAVE(%r9)
+ PIC_SETUP
+#endif
+
+#ifdef __PIC__
+ PIC_LOAD(%r5,__minbrk)
+#else
or.u %r5,%r0,%hi16(__minbrk)
ld %r5,%r5,%lo16(__minbrk)
+#endif
cmp %r3,%r5,%r2
bb1 ls,%r3,1f /* r2 should be > minbrk; can't go below end */
or %r2,%r5,0 /* otherwise, set r2 to minbrk */
@@ -53,9 +62,23 @@ ENTRY(brk)
or %r4,%r2,0
or %r13,%r0,__SYSCALLNAME(SYS_,break)
tb0 0,%r0,128
- br __cerror
+#ifdef __PIC__
+ br.n CERROR
+ PIC_RESTORE(%r9)
+#else
+ br CERROR
+#endif
+
+#ifdef __PIC__
+ PIC_STORE(%r4,__curbrk)
+#else
or.u %r5,%r0,%hi16(__curbrk)
st %r4,%r5,%lo16(__curbrk)
+#endif
or %r2,%r0,0 /* clear r2/r3 to indicate success */
+#ifdef __PIC__
+ PIC_RESTORE(%r9)
+#endif
jmp.n %r1
or %r3,%r0,0
+END(brk)
diff --git a/lib/libc/arch/m88k/sys/cerror.S b/lib/libc/arch/m88k/sys/cerror.S
index 0356d66722e..933f2400067 100644
--- a/lib/libc/arch/m88k/sys/cerror.S
+++ b/lib/libc/arch/m88k/sys/cerror.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cerror.S,v 1.11 2013/01/08 23:06:43 miod Exp $ */
+/* $OpenBSD: cerror.S,v 1.12 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,8 +39,22 @@ WEAK_ALIAS(__cerror,___cerror)
.globl _C_LABEL(errno)
ENTRY(___cerror)
+#ifdef __PIC__
+ PIC_SAVE(%r9)
+ PIC_SETUP
+#endif
+
+#ifdef __PIC__
+ PIC_STORE(%r2,_C_LABEL(errno))
+#else
or.u %r4,%r0,%hi16(_C_LABEL(errno))
st %r2,%r4,%lo16(_C_LABEL(errno))
+#endif
+
+#ifdef __PIC__
+ PIC_RESTORE(%r9)
+#endif
sub %r2,%r0,0x1
jmp.n %r1
sub %r3,%r0,0x1
+END(___cerror)
diff --git a/lib/libc/arch/m88k/sys/exect.S b/lib/libc/arch/m88k/sys/exect.S
index 9c1ae2310e6..4314a5103cb 100644
--- a/lib/libc/arch/m88k/sys/exect.S
+++ b/lib/libc/arch/m88k/sys/exect.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: exect.S,v 1.7 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: exect.S,v 1.8 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,4 +38,5 @@
ENTRY(exect)
or %r13,%r0,SYS_execve
tb0 0,%r0,128 /* exect(file, argv, env) */
- br __cerror
+ br CERROR
+END(exect)
diff --git a/lib/libc/arch/m88k/sys/fork.S b/lib/libc/arch/m88k/sys/fork.S
index 79252bae23a..7980e8a21b4 100644
--- a/lib/libc/arch/m88k/sys/fork.S
+++ b/lib/libc/arch/m88k/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: fork.S,v 1.7 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -43,3 +43,4 @@ SYSCALL(fork)
or %r3,%r0,0
parent:
jmp %r1 /* pid = fork() */
+END(fork)
diff --git a/lib/libc/arch/m88k/sys/sbrk.S b/lib/libc/arch/m88k/sys/sbrk.S
index 2dd6fd9cb27..72d1aa2dda3 100644
--- a/lib/libc/arch/m88k/sys/sbrk.S
+++ b/lib/libc/arch/m88k/sys/sbrk.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbrk.S,v 1.9 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: sbrk.S,v 1.10 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -45,18 +45,44 @@ __curbrk:
.text
ENTRY(sbrk)
+#ifdef __PIC__
+ PIC_SAVE(%r9)
+ PIC_SETUP
+#endif
+
+#ifdef __PIC__
+ PIC_LOAD(%r5,__curbrk)
+#else
or.u %r5,%r0,%hi16(__curbrk)
ld %r5,%r5,%lo16(__curbrk)
+#endif
add %r2,%r2,%r5
or %r4,%r2,0
or %r13,%r0,SYS_break
tb0 0,%r0,128
- br __cerror
+#ifdef __PIC__
+ br.n CERROR
+ PIC_RESTORE(%r9)
+#else
+ br CERROR
+#endif
/* Save old __curbrk */
+#ifdef __PIC__
+ PIC_LOAD(%r2,__curbrk)
+#else
or.u %r5,%r0,%hi16(__curbrk)
ld %r2,%r5,%lo16(__curbrk)
+#endif
/* Update __curbrk */
+#ifdef __PIC__
+ PIC_STORE(%r4,__curbrk)
+#else
st %r4,%r5,%lo16(__curbrk)
+#endif
/* and return old __curbrk */
+#ifdef __PIC__
+ PIC_RESTORE(%r9)
+#endif
jmp.n %r1
or %r3,%r0,0
+END(sbrk)
diff --git a/lib/libc/arch/m88k/sys/sigpending.S b/lib/libc/arch/m88k/sys/sigpending.S
index e2746e39ada..6abc1c3e790 100644
--- a/lib/libc/arch/m88k/sys/sigpending.S
+++ b/lib/libc/arch/m88k/sys/sigpending.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigpending.S,v 1.7 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: sigpending.S,v 1.8 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,7 +39,8 @@ ENTRY(sigpending)
or %r4,%r2,0 /* save r2 */
or %r13,%r0,SYS_sigpending
tb0 0,%r0,128
- br __cerror
+ br CERROR
st %r2,%r4,0
jmp.n %r1
or %r2,%r0,0
+END(sigpending)
diff --git a/lib/libc/arch/m88k/sys/sigprocmask.S b/lib/libc/arch/m88k/sys/sigprocmask.S
index 136bdd505bc..5b371369052 100644
--- a/lib/libc/arch/m88k/sys/sigprocmask.S
+++ b/lib/libc/arch/m88k/sys/sigprocmask.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigprocmask.S,v 1.8 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: sigprocmask.S,v 1.9 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -44,9 +44,10 @@ SYSENTRY(sigprocmask)
2:
or %r13,%r0,SYS_sigprocmask
tb0 0,%r0,128
- br __cerror
+ br CERROR
bcnd eq0,%r4,3f /* if old mask not requested, done */
st %r2,%r4,0 /* otherwise, set it */
3:
jmp.n %r1
or %r2,%r0,0
+END(sigprocmask)
diff --git a/lib/libc/arch/m88k/sys/sigreturn.S b/lib/libc/arch/m88k/sys/sigreturn.S
index 9919b5221fe..3c2f1f59586 100644
--- a/lib/libc/arch/m88k/sys/sigreturn.S
+++ b/lib/libc/arch/m88k/sys/sigreturn.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigreturn.S,v 1.8 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: sigreturn.S,v 1.9 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,5 +39,4 @@
* We must preserve the state of the registers as the user has set them up.
*/
-SYSCALL(sigreturn)
- jmp %r1
+RSYSCALL(sigreturn)
diff --git a/lib/libc/arch/m88k/sys/sigsuspend.S b/lib/libc/arch/m88k/sys/sigsuspend.S
index 22ba6ef9d43..da1e2ce6aff 100644
--- a/lib/libc/arch/m88k/sys/sigsuspend.S
+++ b/lib/libc/arch/m88k/sys/sigsuspend.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigsuspend.S,v 1.9 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: sigsuspend.S,v 1.10 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -46,6 +46,7 @@ SYSENTRY(sigsuspend)
ld %r2,%r2,0 /* dereference the pointer mask */
or %r13,%r0,SYS_sigsuspend
tb0 0,%r0,128
- br __cerror
+ br CERROR
jmp.n %r1
or %r2,%r0,0
+END(sigsuspend)
diff --git a/lib/libc/arch/m88k/sys/syscall.S b/lib/libc/arch/m88k/sys/syscall.S
index f2da5052cb8..20edad9d22c 100644
--- a/lib/libc/arch/m88k/sys/syscall.S
+++ b/lib/libc/arch/m88k/sys/syscall.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.S,v 1.11 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: syscall.S,v 1.12 2013/01/11 21:23:24 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,5 +38,6 @@
SYSENTRY(syscall)
or %r13,%r0,0
tb0 0,%r0,128
- br __cerror
+ br CERROR
jmp %r1
+END(syscall)
diff --git a/lib/libc/arch/m88k/sys/tfork_thread.S b/lib/libc/arch/m88k/sys/tfork_thread.S
index c59175da276..88e1524339c 100644
--- a/lib/libc/arch/m88k/sys/tfork_thread.S
+++ b/lib/libc/arch/m88k/sys/tfork_thread.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: tfork_thread.S,v 1.3 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: tfork_thread.S,v 1.4 2013/01/11 21:23:24 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -33,7 +33,7 @@
ENTRY(__tfork_thread)
or %r13, %r0, __SYSCALLNAME(SYS_,__tfork)
tb0 0, %r0, 128 /* corrupts r2 and r3 in the child */
- br __cerror
+ br CERROR
bcnd eq0, %r2, 1f
@@ -51,3 +51,4 @@ ENTRY(__tfork_thread)
or %r13, %r0, __SYSCALLNAME(SYS_,__threxit)
tb0 0, %r0, 128
+END(__tfork_thread)