-/* $OpenBSD: ldasm.S,v 1.22 2016/05/07 19:05:23 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.23 2016/08/09 03:58:35 guenther Exp $ */
/*
* Copyright (c) 2004 Dale Rahn
mov r0, fp @ original stack
mov r1, r7 @ dl_data
+ ldr r8, .L_GOT @ calculate address of GOT...
+1: add r8, pc, r8 @ into r8
+
+ ldr r2, .L__DYNAMIC @ &_DYNAMIC
+ add r2, r2, r8
+
bl _dl_boot_bind
add r0, r5, #4 @ argv
mov lr, r6
mov r1, r0
- ldr r2, .L_GOT
-1:
- add r2, pc, r2
ldr r0, .L_dl_dtors
- add r0, r0, r2
+ add r0, r0, r8
mov pc, r1
.L_GOT:
.long _GLOBAL_OFFSET_TABLE_-(1b+8)
+.L__DYNAMIC:
+ .long _DYNAMIC(GOTOFF)
.L_dl_dtors:
.long _dl_dtors(GOTOFF)
-/* $OpenBSD: boot.c,v 1.12 2016/08/07 03:05:23 guenther Exp $ */
+/* $OpenBSD: boot.c,v 1.13 2016/08/09 03:58:35 guenther Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
* Scan the DYNAMIC section for the loader.
* Cache the data for easier access.
*/
-
-#if defined(__arm__)
- dynp = (Elf_Dyn *)((long)_DYNAMIC + loff);
-#else
dynp = dynamicp;
-#endif
_dl_memset(&dynld, 0, sizeof(dynld));
while (dynp->d_tag != DT_NULL) {