summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-08-07 02:30:56 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-08-07 02:30:56 +0000
commitab1f969fbfd326e67461d21a90649455853d1669 (patch)
treee57c7cf3dfd579bc47d541622d7b720c804d6ce7 /lib
parent9117abe95fa960b64ff9f607ae19507f210d7241 (diff)
Teach i386 to pass &_DYNAMIC to _dl_boot_bind()
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/boot.h4
-rw-r--r--lib/csu/i386/md_init.h5
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/csu/boot.h b/lib/csu/boot.h
index da699efb6d2..88aee9556af 100644
--- a/lib/csu/boot.h
+++ b/lib/csu/boot.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.h,v 1.18 2016/08/07 02:30:04 guenther Exp $ */
+/* $OpenBSD: boot.h,v 1.19 2016/08/07 02:30:55 guenther Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -148,7 +148,7 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynamicp)
#if defined(__alpha__)
dynp = (Elf_Dyn *)((long)_DYNAMIC);
-#elif defined(__i386__) || defined(__mips64__)
+#elif defined(__mips64__)
dynp = (Elf_Dyn *)((long)_DYNAMIC + loff);
#else
dynp = dynamicp;
diff --git a/lib/csu/i386/md_init.h b/lib/csu/i386/md_init.h
index 33fc12cc6ae..a7fba833de6 100644
--- a/lib/csu/i386/md_init.h
+++ b/lib/csu/i386/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.7 2016/03/20 02:32:39 guenther Exp $ */
+/* $OpenBSD: md_init.h,v 1.8 2016/08/07 02:30:55 guenther Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@@ -95,7 +95,8 @@
"__start: \n" \
" movl %esp,%eax # save SP for dl_boot_bind \n" \
" subl $16*4,%esp # allocate dl_data \n" \
- " pushl $0 # push 0 for dynamicp (unused on i386) \n" \
+ " call 1f # push &_DYNAMIC... \n" \
+ "1: addl $(_DYNAMIC-1b),(%esp) # ...for dl_boot_bind \n" \
" movl %esp,%ebx \n" \
" pushl %ebx # push dl_data for dl_boot_bind \n" \
" \n" \