summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2013-12-23 22:24:37 +0000
committerkettenis <kettenis@openbsd.org>2013-12-23 22:24:37 +0000
commitac32b27e1a98361b6533d38c6acf02ccd197701a (patch)
treed46e04fdcab89ad69b6fb757cd78db4eade3405e
parentMake ld.so pass its cleanup handler in %rdx as required by the AMD64 System V (diff)
downloadwireguard-openbsd-ac32b27e1a98361b6533d38c6acf02ccd197701a.tar.xz
wireguard-openbsd-ac32b27e1a98361b6533d38c6acf02ccd197701a.zip
Use slightly diffrerent code to get the global offset table address. This
version will match the (upcoming) 32-bit version (for sparc) and allegedly is slightly faster.
-rw-r--r--libexec/ld.so/sparc64/ldasm.S10
1 files changed, 5 insertions, 5 deletions
diff --git a/libexec/ld.so/sparc64/ldasm.S b/libexec/ld.so/sparc64/ldasm.S
index 209fdf1a74a..a9638fb5b02 100644
--- a/libexec/ld.so/sparc64/ldasm.S
+++ b/libexec/ld.so/sparc64/ldasm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldasm.S,v 1.33 2013/12/23 17:29:15 kettenis Exp $ */
+/* $OpenBSD: ldasm.S,v 1.34 2013/12/23 22:24:37 kettenis Exp $ */
/* $NetBSD: rtld_start.S,v 1.5 2001/08/14 22:17:48 eeh Exp $ */
/*
@@ -129,10 +129,10 @@ _ENTRY(_dl_start)
add %sp, 48 + DL_DATA_SIZE, %sp ! restore stack
- sethi %hi(_GLOBAL_OFFSET_TABLE_ - 4), %l7
- rd %pc, %g1
- or %l7, %lo(_GLOBAL_OFFSET_TABLE_ + 4), %l7
- add %l7, %g1, %l7
+1: call 2f
+ sethi %hi(_GLOBAL_OFFSET_TABLE_+(.-1b)), %l7
+2: or %l7, %lo(_GLOBAL_OFFSET_TABLE_+(.-1b)), %l7
+ add %l7, %o7, %l7
jmp %o0
ldx [%l7 + _dl_dtors], %g1 ! %g1 = cleanup