From: guenther Date: Sun, 7 Aug 2016 03:03:44 +0000 (+0000) Subject: Teach i386 to pass &_DYNAMIC to _dl_boot_bind() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=94bdeb90245ced851e5d0654af0e1e907a9b347f;p=openbsd Teach i386 to pass &_DYNAMIC to _dl_boot_bind() --- 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