diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2016-08-07 03:03:45 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2016-08-07 03:03:45 +0000 |
commit | 06c7f4ed1a38f5899f20c1fc4ca972330277722f (patch) | |
tree | 6e7e0d77a3161b917c016e70e188520533aea900 | |
parent | 786f473778ab7c7c53042ac7636c4e1699904965 (diff) |
Teach i386 to pass &_DYNAMIC to _dl_boot_bind()
-rw-r--r-- | libexec/ld.so/boot.c | 4 | ||||
-rw-r--r-- | libexec/ld.so/i386/ldasm.S | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/libexec/ld.so/boot.c b/libexec/ld.so/boot.c index 5adc7c13b99..7f2661751fa 100644 --- a/libexec/ld.so/boot.c +++ b/libexec/ld.so/boot.c @@ -1,4 +1,4 @@ -/* $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 @@ -129,7 +129,7 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynamicp) #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; diff --git a/libexec/ld.so/i386/ldasm.S b/libexec/ld.so/i386/ldasm.S index 621a1c503be..2476e1c73ca 100644 --- a/libexec/ld.so/i386/ldasm.S +++ b/libexec/ld.so/i386/ldasm.S @@ -1,4 +1,4 @@ -/* $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 @@ -39,7 +39,8 @@ _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 |