From 8ecb3577d83113cde0885b76799ccebb323abf8b Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 25 Sep 2003 01:10:26 +0000 Subject: Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bit systems where the data/stack/etc limits are too big for a 32 bit process. Move the 5 or so identical instances of ELF_RTLD_ADDR() into imgact_elf.c. Supply an ia32_fixlimits function. Export the clip/default values to sysctl under the compat.ia32 heirarchy. Have mmap(0, ...) respect the current p->p_limits[RLIMIT_DATA].rlim_max value rather than the sysctl tweakable variable. This allows mmap to place mappings at sensible locations when limits have been reduced. Have the imgact_elf.c ld-elf.so.1 placement algorithm use the same method as mmap(0, ...) now does. Note that we cannot remove all references to the sysctl tweakable maxdsiz etc variables because /etc/login.conf specifies a datasize of 'unlimited'. And that causes exec etc to fail since it can no longer find space to mmap things. --- sys/powerpc/include/elf.h | 12 ------------ sys/powerpc/powerpc/elf_machdep.c | 3 ++- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'sys/powerpc') diff --git a/sys/powerpc/include/elf.h b/sys/powerpc/include/elf.h index 01248f0..7fc1b36 100644 --- a/sys/powerpc/include/elf.h +++ b/sys/powerpc/include/elf.h @@ -158,16 +158,4 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_PPC #define ELF_TARG_VER 1 -#ifdef _KERNEL - -/* - * On the PowerPC 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) \ - (round_page((vm_offset_t)(vmspace)->vm_daddr + maxdsiz)) - -#endif /* _KERNEL */ #endif /* !_MACHINE_ELF_H_ */ diff --git a/sys/powerpc/powerpc/elf_machdep.c b/sys/powerpc/powerpc/elf_machdep.c index 72b6a55..eab70db 100644 --- a/sys/powerpc/powerpc/elf_machdep.c +++ b/sys/powerpc/powerpc/elf_machdep.c @@ -72,7 +72,8 @@ struct sysentvec elf32_freebsd_sysvec = { PS_STRINGS, VM_PROT_ALL, exec_copyout_strings, - exec_setregs + exec_setregs, + NULL }; static Elf32_Brandinfo freebsd_brand_info = { -- cgit v1.1