summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/alpha/include/elf.h14
-rw-r--r--sys/amd64/include/elf.h12
-rw-r--r--sys/i386/include/elf.h12
-rw-r--r--sys/kern/imgact_elf.c4
4 files changed, 37 insertions, 5 deletions
diff --git a/sys/alpha/include/elf.h b/sys/alpha/include/elf.h
index 3972adb..26e912e 100644
--- a/sys/alpha/include/elf.h
+++ b/sys/alpha/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.4 1998/08/17 08:05:55 dfr Exp $
+ * $Id: elf.h,v 1.5 1998/09/14 20:30:08 jdp Exp $
*/
#ifndef _MACHINE_ELF_H_
@@ -135,4 +135,16 @@ __ElfType(Auxinfo);
#define ELF_TARG_MACH EM_ALPHA
#define ELF_TARG_VER 1
+#ifdef KERNEL
+
+/*
+ * On the Alpha 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 can 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/amd64/include/elf.h b/sys/amd64/include/elf.h
index 93f486b..c6bedaf 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.4 1998/09/14 20:30:12 jdp Exp $
+ * $Id: elf.h,v 1.5 1998/10/18 15:31:23 peter Exp $
*/
#ifndef _MACHINE_ELF_H_
@@ -118,4 +118,14 @@ __ElfType(Auxinfo);
#define ELF_TARG_MACH EM_386
#define ELF_TARG_VER 1
+#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.
+ */
+#define ELF_RTLD_ADDR(vmspace) 0x08000000
+
+#endif /* KERNEL */
#endif /* !_MACHINE_ELF_H_ */
diff --git a/sys/i386/include/elf.h b/sys/i386/include/elf.h
index 93f486b..c6bedaf 100644
--- a/sys/i386/include/elf.h
+++ b/sys/i386/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.4 1998/09/14 20:30:12 jdp Exp $
+ * $Id: elf.h,v 1.5 1998/10/18 15:31:23 peter Exp $
*/
#ifndef _MACHINE_ELF_H_
@@ -118,4 +118,14 @@ __ElfType(Auxinfo);
#define ELF_TARG_MACH EM_386
#define ELF_TARG_VER 1
+#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.
+ */
+#define ELF_RTLD_ADDR(vmspace) 0x08000000
+
+#endif /* KERNEL */
#endif /* !_MACHINE_ELF_H_ */
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 38f70d9..6d9586e 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: imgact_elf.c,v 1.51 1999/02/05 22:24:26 jdp Exp $
+ * $Id: imgact_elf.c,v 1.52 1999/02/07 21:48:21 dillon Exp $
*/
#include "opt_rlimit.h"
@@ -522,7 +522,7 @@ exec_elf_imgact(struct image_params *imgp)
vmspace->vm_dsize = data_size >> PAGE_SHIFT;
vmspace->vm_daddr = (caddr_t)(uintptr_t)data_addr;
- addr = 2L*MAXDSIZ; /* May depend on OS type XXX */
+ addr = ELF_RTLD_ADDR(vmspace);
imgp->entry_addr = entry;
OpenPOWER on IntegriCloud