diff options
| author | 2013-01-24 05:24:47 +0000 | |
|---|---|---|
| committer | 2013-01-24 05:24:47 +0000 | |
| commit | 46f272baf59be8742c6690ad0749b06e7fe38f18 (patch) | |
| tree | f95037f473acaa571d1e663ff0c074e36488388e /lib/libc | |
| parent | m88k_expand_prologue(): add a REG_MAYBE_DEAD note to the insns loading the (diff) | |
| download | wireguard-openbsd-46f272baf59be8742c6690ad0749b06e7fe38f18.tar.xz wireguard-openbsd-46f272baf59be8742c6690ad0749b06e7fe38f18.zip | |
Oops, due to the way return from system calls work, we can not use a delay
slot in the branch to cerror, for the delay slot instruction would also run
as part of a successful return. Doh. Fortunately almost nothing in the tree
uses brk() or sbrk() anymore... but binaries linked against libiberty.
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/arch/m88k/sys/brk.S | 11 | ||||
| -rw-r--r-- | lib/libc/arch/m88k/sys/sbrk.S | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/lib/libc/arch/m88k/sys/brk.S b/lib/libc/arch/m88k/sys/brk.S index 8676d6a0425..34f9f856174 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.11 2013/01/23 18:59:32 miod Exp $ */ +/* $OpenBSD: brk.S,v 1.12 2013/01/24 05:24:47 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -63,8 +63,7 @@ ENTRY(brk) or %r13,%r0,__SYSCALLNAME(SYS_,break) tb0 0,%r0,450 #ifdef __PIC__ - br.n CERROR - PIC_RESTORE(%r9) + br 9f #else br CERROR #endif @@ -81,4 +80,10 @@ ENTRY(brk) #endif jmp.n %r1 or %r3,%r0,0 + +#ifdef __PIC__ +9: + br.n CERROR + PIC_RESTORE(%r9) +#endif END(brk) diff --git a/lib/libc/arch/m88k/sys/sbrk.S b/lib/libc/arch/m88k/sys/sbrk.S index 679f0201c49..9902bddbc49 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.11 2013/01/23 18:59:32 miod Exp $ */ +/* $OpenBSD: sbrk.S,v 1.12 2013/01/24 05:24:47 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -61,8 +61,7 @@ ENTRY(sbrk) or %r13,%r0,SYS_break tb0 0,%r0,450 #ifdef __PIC__ - br.n CERROR - PIC_RESTORE(%r9) + br 9f #else br CERROR #endif @@ -85,4 +84,10 @@ ENTRY(sbrk) #endif jmp.n %r1 or %r3,%r0,0 + +#ifdef __PIC__ +9: + br.n CERROR + PIC_RESTORE(%r9) +#endif END(sbrk) |
