summaryrefslogtreecommitdiffstats
path: root/sys/alpha/include
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1999-02-07 23:49:56 +0000
committerjdp <jdp@FreeBSD.org>1999-02-07 23:49:56 +0000
commitbbafa43d0d94b57b8a30d6b86b299ca10312fafa (patch)
tree142fc50062ca65ff2943cc724a6ed77e19a8e188 /sys/alpha/include
parent98732ec693124cdb1b12cb82c7cf62606842becd (diff)
downloadFreeBSD-src-bbafa43d0d94b57b8a30d6b86b299ca10312fafa.zip
FreeBSD-src-bbafa43d0d94b57b8a30d6b86b299ca10312fafa.tar.gz
Change the load address of the ELF dynamic linker from "2L*MAXDSIZ"
to an architecture-specific value defined in <machine/elf.h>. This solves problems on large-memory systems that have a high value for MAXDSIZ. The load address is controlled by a new macro ELF_RTLD_ADDR(vmspace). On the i386 it is hard-wired to 0x08000000, which is the standard SVR4 location for the dynamic linker. On the Alpha, the dynamic linker is loaded MAXDSIZ bytes beyond the start of the program's data segment. This is the same place a userland mmap(0, ...) call would put it, so it ends up just below all the shared libraries. The rationale behind the calculation is that it allows room for the data segment to grow to its maximum possible size. These changes have been tested on the i386 for several months without problems. They have been tested on the Alpha as well, though not for nearly as long. I would like to merge the changes into 3.1 within a week if no problems have surfaced as a result of them.
Diffstat (limited to 'sys/alpha/include')
-rw-r--r--sys/alpha/include/elf.h14
1 files changed, 13 insertions, 1 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_ */
OpenPOWER on IntegriCloud