summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-12-25 15:01:40 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-12-25 15:01:40 +0000
commit3cda5727ce151dc2d79eae4742d1d7ba732ead80 (patch)
treed22755217ff5ee359c3c675c81f7a5b253944cb9 /libexec
parent30860e647b2babe0734ae074a44fd5eb0ce4f64f (diff)
Pass _dl_dtors as the csu cleanup routine on arm.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/arm/ldasm.S12
-rw-r--r--libexec/ld.so/loader.c4
2 files changed, 12 insertions, 4 deletions
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?