summaryrefslogtreecommitdiff
path: root/lib/libc/arch/powerpc
diff options
context:
space:
mode:
authorDale S. Rahn <rahnds@cvs.openbsd.org>1999-04-21 03:43:24 +0000
committerDale S. Rahn <rahnds@cvs.openbsd.org>1999-04-21 03:43:24 +0000
commitff46cec675ef41542b7691fce09d7735aa5ee68d (patch)
tree315d610be0afab66a64c0be4062fc578bd7824ad /lib/libc/arch/powerpc
parent77cbe1cf837b2c4e73e16d7a66255334db8a9410 (diff)
Fix the _THREAD_SAFE path through the cerror code for powerpc.
libc_r was never completed for the powerpc arch.
Diffstat (limited to 'lib/libc/arch/powerpc')
-rw-r--r--lib/libc/arch/powerpc/sys/cerror.S16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/libc/arch/powerpc/sys/cerror.S b/lib/libc/arch/powerpc/sys/cerror.S
index f8f2fa25877..de7782066bd 100644
--- a/lib/libc/arch/powerpc/sys/cerror.S
+++ b/lib/libc/arch/powerpc/sys/cerror.S
@@ -5,6 +5,8 @@
ENTRY(cerror)
#if defined(_THREAD_SAFE) || defined (PIC)
stwu 1, -16(1) /* follow the SVR4 ABI */
+ mflr 3 /* error value is in r0, use r3 */
+ stw 3, 20(1)
#endif
#ifndef PIC
# ifndef _THREAD_SAFE
@@ -12,29 +14,21 @@ ENTRY(cerror)
ori 5, 5, errno@L
# else
mr 9, 0
- mflr 10
bl _C_LABEL(__error)
- mr 3, 5
- mtlr 10
+ mr 5, 3
mr 0, 9
# endif
#else
# ifndef _THREAD_SAFE
- mflr 10
bl _GLOBAL_OFFSET_TABLE_@local-4
mflr 4
- mtlr 10
lwz 5,_C_LABEL(errno)@got(4)
# else
- mflr 10
- stw 10, 20(1)
stw 0, 12(1)
bl PIC_PLT(_C_LABEL(__error))
mr 5, 3
- lwz 10, 12(1)
- mtlr 10
- lwz 0, 20(1)
+ lwz 0, 12(1)
# endif
#endif
@@ -42,6 +36,8 @@ ENTRY(cerror)
addi 3, 0, -1
addi 4, 0, -1
#if defined(_THREAD_SAFE) || defined (PIC)
+ lwz 0, 20(1)
+ mtlr 0
addi 1, 1, 16 /* follow the SVR4 ABI */
#endif
blr