From: miod Date: Wed, 25 Dec 2013 15:01:39 +0000 (+0000) Subject: Pass _dl_dtors as the csu cleanup routine on arm. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9ede8e9c938aa673909d680550f88940461be8c5;p=openbsd Pass _dl_dtors as the csu cleanup routine on arm. --- diff --git a/libexec/ld.so/arm/ldasm.S b/libexec/ld.so/arm/ldasm.S index 36eb0f17031..10a1f3a57e1 100644 --- a/libexec/ld.so/arm/ldasm.S +++ b/libexec/ld.so/arm/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.11 2013/08/13 05:52:18 guenther Exp $ */ +/* $OpenBSD: ldasm.S,v 1.12 2013/12/25 15:01:39 miod Exp $ */ /* * Copyright (c) 2004 Dale Rahn @@ -56,8 +56,16 @@ ENTRY(_dl_start) mov lr, r6 mov r1, r0 - mov r0, #0 + ldr r2, .L_GOT +1: + add r2, pc, r2 + ldr r0, .L_dl_dtors + add r0, r0, r2 mov pc, r1 +.L_GOT: + .long _GLOBAL_OFFSET_TABLE_-(1b+8) +.L_dl_dtors: + .long _dl_dtors(GOTOFF) ENTRY(_dl_bind_start) diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c index b137fbc6033..c978e269e31 100644 --- a/libexec/ld.so/loader.c +++ b/libexec/ld.so/loader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: loader.c,v 1.142 2013/12/25 13:06:00 miod Exp $ */ +/* $OpenBSD: loader.c,v 1.143 2013/12/25 15:01:39 miod 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(__arm__) || defined(__mips64__) || defined(__sh__) /* XXX */ +#if defined(__mips64__) || defined(__sh__) /* XXX */ /* * Schedule a routine to be run at shutdown, by using atexit. * Cannot call atexit directly from ld.so?