summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Miller <kurt@cvs.openbsd.org>2008-09-29 13:42:23 +0000
committerKurt Miller <kurt@cvs.openbsd.org>2008-09-29 13:42:23 +0000
commitf9c41637927e81b81bf3a53975112d28ba7ef3ef (patch)
tree1d7d500f48048080b2ebbadc31f01f5df0c38e4f
parent0ad2499d43626ae45a59f62eb365a9daf5bb18ee (diff)
Use large pic asm for access to errno (needed for pie). Originally from
drahn@ but tweaked to use same scratch reg as PIC_PROLOGUE. okay miod@ drahn@
-rw-r--r--lib/libc/arch/sparc64/sys/cerror.S6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/arch/sparc64/sys/cerror.S b/lib/libc/arch/sparc64/sys/cerror.S
index fe452ffe5c9..45b41038610 100644
--- a/lib/libc/arch/sparc64/sys/cerror.S
+++ b/lib/libc/arch/sparc64/sys/cerror.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cerror.S,v 1.2 2003/06/02 20:18:33 millert Exp $ */
+/* $OpenBSD: cerror.S,v 1.3 2008/09/29 13:42:22 kurt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -41,7 +41,9 @@
#ifdef PIC
FUNC(__cerror)
PIC_PROLOGUE(%g1, %o3)
- ldx [%g1 + _C_LABEL(errno)], %g1
+ sethi %hi(_C_LABEL(errno)), %o3
+ or %o3, %lo(_C_LABEL(errno)), %o3
+ ldx [ %g1 + %o3 ], %g1
st %o0, [%g1]
mov -1, %o0
retl