-/* $OpenBSD: boot.c,v 1.10 2016/08/07 03:01:53 guenther Exp $ */
+/* $OpenBSD: boot.c,v 1.11 2016/08/07 03:03:44 guenther Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
#if defined(__alpha__)
dynp = (Elf_Dyn *)((long)_DYNAMIC);
-#elif defined(__arm__) || defined(__i386__)
+#elif defined(__arm__)
dynp = (Elf_Dyn *)((long)_DYNAMIC + loff);
#else
dynp = dynamicp;
-/* $OpenBSD: ldasm.S,v 1.26 2016/05/07 19:05:23 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.27 2016/08/07 03:03:44 guenther Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
_dl_start:
movl %esp,%eax # save stack pointer for _rtld
subl $DL_DATA_SIZE,%esp # allocate dl_data
- pushl $0 # push 0 for dynamicp (unused on i386)
+ call 1f # push &_DYNAMIC...
+1: addl $(_DYNAMIC-1b),(%esp) # ...for dl_boot_bind
movl %esp,%ebx
movl %ebx,%edi # save dl_data arg for dl_boot
pushl %ebx # push dl_data for dl_boot_bind