diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-12-23 21:18:58 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-12-23 21:18:58 +0000 |
commit | a5a8362408204c7b9408582aee4f08ddc3981351 (patch) | |
tree | 119cc5e11acbba129333a4598e4683164aef088b | |
parent | cd85212ebe424ed9f1469ebef624ad15f4154c88 (diff) |
Make ld.so pass its cleanup handler in v0 and stop calling atexit(4) directly
from ld.so on alpha. Note that this means that binaries built before early
december may no longer call destructors in shared libraries implemented in
C++. Update your packages!
-rw-r--r-- | libexec/ld.so/alpha/ldasm.S | 4 | ||||
-rw-r--r-- | libexec/ld.so/loader.c | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/libexec/ld.so/alpha/ldasm.S b/libexec/ld.so/alpha/ldasm.S index 9998289e2db..615da6c9578 100644 --- a/libexec/ld.so/alpha/ldasm.S +++ b/libexec/ld.so/alpha/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.22 2013/11/10 19:23:14 guenther Exp $ */ +/* $OpenBSD: ldasm.S,v 1.23 2013/12/23 21:18:57 kettenis Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -103,7 +103,7 @@ L2: ldiq s3, L2 /* get where the linker thought we were */ mov s2, a3 /* dl_data */ CALL(_dl_boot) mov s0, a0 /* stack */ - mov zero, a1 /* cleanup */ + lda a1, _dl_dtors /* cleanup */ mov v0, pv jsr ra, (pv) END(_dl_start) diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c index 0ac37b8e5b4..c8f43f951b3 100644 --- a/libexec/ld.so/loader.c +++ b/libexec/ld.so/loader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: loader.c,v 1.137 2013/12/23 17:29:15 kettenis Exp $ */ +/* $OpenBSD: loader.c,v 1.138 2013/12/23 21:18:57 kettenis Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -604,7 +604,8 @@ _dl_boot(const char **argv, char **envp, const long dyn_loff, long *dl_data) _dl_call_init(_dl_objects); } -#if !defined(__hppa__) && !defined(__i386__) && !defined(__sparc64__) +#if !defined(__alpha__) && !defined(__hppa__) && !defined(__i386__) && \ + !defined(__sparc64__) /* * Schedule a routine to be run at shutdown, by using atexit. * Cannot call atexit directly from ld.so? |