summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/elf.h
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1999-02-19 01:30:43 +0000
committerjdp <jdp@FreeBSD.org>1999-02-19 01:30:43 +0000
commite5f9ac5dad29d4d2db874390f673ac240ca987db (patch)
tree1ab9b8f4a01a8fe739012d85fe9d55d29b391e8a /sys/amd64/include/elf.h
parent63384a57800603f87a870c3d17a5ade7e3ab06db (diff)
downloadFreeBSD-src-e5f9ac5dad29d4d2db874390f673ac240ca987db.zip
FreeBSD-src-e5f9ac5dad29d4d2db874390f673ac240ca987db.tar.gz
On the i386, load the ELF dynamic linker where an mmap(0, ...) would
put it, just like on the Alpha. It was wrong to load it at the fixed address 0x08000000. That should only be done if the dynamic linker is an executable (not a shared object) with a specific load address encoded in the object file itself. This fixes the recent breakage in the Linux emulator.
Diffstat (limited to 'sys/amd64/include/elf.h')
-rw-r--r--sys/amd64/include/elf.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/amd64/include/elf.h b/sys/amd64/include/elf.h
index c6bedaf..ac0cce3 100644
--- a/sys/amd64/include/elf.h
+++ b/sys/amd64/include/elf.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: elf.h,v 1.5 1998/10/18 15:31:23 peter Exp $
+ * $Id: elf.h,v 1.6 1999/02/07 23:49:55 jdp Exp $
*/
#ifndef _MACHINE_ELF_H_
@@ -121,11 +121,13 @@ __ElfType(Auxinfo);
#ifdef KERNEL
/*
- * On the i386 we load the dynamic linker at a fixed address,
- * below where the executable itself is loaded. This is the
- * standard SVR4 location for it.
+ * On the i386 we load the dynamic linker where a userland call
+ * to mmap(0, ...) would put it. The rationale behind this
+ * calculation is that it leaves room for the heap to grow to
+ * its maximum allowed size.
*/
-#define ELF_RTLD_ADDR(vmspace) 0x08000000
+#define ELF_RTLD_ADDR(vmspace) \
+ (round_page((vm_offset_t)(vmspace)->vm_daddr + MAXDSIZ))
#endif /* KERNEL */
#endif /* !_MACHINE_ELF_H_ */
OpenPOWER on IntegriCloud