diff options
author | 2013-12-23 17:29:15 +0000 | |
---|---|---|
committer | 2013-12-23 17:29:15 +0000 | |
commit | 00e32157c079f749acd170581587744f39e125f8 (patch) | |
tree | faeffaf6b1b4e2c46cf219fe39e7642940f468c3 | |
parent | Move KASSERT a bit further down because it can apparently be triggered by (diff) | |
download | wireguard-openbsd-00e32157c079f749acd170581587744f39e125f8.tar.xz wireguard-openbsd-00e32157c079f749acd170581587744f39e125f8.zip |
Make ld.so pass its cleanup handler in %g1 as required by the SPARC System V
ABI, and stop calling atexit(4) directly from ld.so on sparc64
-rw-r--r-- | libexec/ld.so/loader.c | 4 | ||||
-rw-r--r-- | libexec/ld.so/sparc64/ldasm.S | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c index e634e96e3cc..0ac37b8e5b4 100644 --- a/libexec/ld.so/loader.c +++ b/libexec/ld.so/loader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: loader.c,v 1.136 2013/12/23 14:13:03 kettenis Exp $ */ +/* $OpenBSD: loader.c,v 1.137 2013/12/23 17:29:15 kettenis Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -604,7 +604,7 @@ _dl_boot(const char **argv, char **envp, const long dyn_loff, long *dl_data) _dl_call_init(_dl_objects); } -#if !defined(__hppa__) && !defined(__i386__) +#if !defined(__hppa__) && !defined(__i386__) && !defined(__sparc64__) /* * Schedule a routine to be run at shutdown, by using atexit. * Cannot call atexit directly from ld.so? diff --git a/libexec/ld.so/sparc64/ldasm.S b/libexec/ld.so/sparc64/ldasm.S index 982deaaee59..209fdf1a74a 100644 --- a/libexec/ld.so/sparc64/ldasm.S +++ b/libexec/ld.so/sparc64/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.32 2013/08/13 05:52:21 guenther Exp $ */ +/* $OpenBSD: ldasm.S,v 1.33 2013/12/23 17:29:15 kettenis Exp $ */ /* $NetBSD: rtld_start.S,v 1.5 2001/08/14 22:17:48 eeh Exp $ */ /* @@ -129,8 +129,13 @@ _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 + jmp %o0 - clr %g1 ! XXX don't register with atexit + ldx [%l7 + _dl_dtors], %g1 ! %g1 = cleanup /* * We have two separate entry points to the runtime linker. |