diff options
author | 2008-09-29 13:42:22 +0000 | |
---|---|---|
committer | 2008-09-29 13:42:22 +0000 | |
commit | f89a7a4a6a098da57fae10e8732da10a138048f5 (patch) | |
tree | 18a14c9f8f3fbc9ee26987cd4127c4498ccf8efd | |
parent | enable JMicron Ethernet (jme/jmphy) (diff) | |
download | wireguard-openbsd-f89a7a4a6a098da57fae10e8732da10a138048f5.tar.xz wireguard-openbsd-f89a7a4a6a098da57fae10e8732da10a138048f5.zip |
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.S | 6 |
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 |