-/* $OpenBSD: loader.c,v 1.140 2013/12/23 22:13:03 kettenis Exp $ */
+/* $OpenBSD: loader.c,v 1.141 2013/12/25 11:10:02 kettenis Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
}
#if !defined(__alpha__) && !defined(__amd64__) && !defined(__hppa__) && \
- !defined(__i386__) && !defined(__powerpc__) && !defined(__sparc64__)
+ !defined(__i386__) && !defined(__powerpc__) && !defined(__sparc__) && \
+ !defined(__sparc64__)
/*
* Schedule a routine to be run at shutdown, by using atexit.
* Cannot call atexit directly from ld.so?
-/* $OpenBSD: ldasm.S,v 1.21 2013/08/13 05:52:21 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.22 2013/12/25 11:10:02 kettenis Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
add %sp, 32 + DL_DATA_SIZE, %sp ! restore stack
+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
- clr %g1 ! XXX don't register with atexit
+ ld [%l7 + _dl_dtors], %g1 ! %g1 = cleanup
.section ".text"