This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] MIPS/ELF64: Set text address beyond 4 GB
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- To: binutils at sources dot redhat dot com
- Date: Wed, 21 May 2003 14:52:58 +0200 (MET DST)
- Subject: [patch] MIPS/ELF64: Set text address beyond 4 GB
- Organization: Technical University of Gdansk
Hello,
Setting text segment's start address above 4 GB for 64-bit executables
aids in finding unportable software -- if a pointer is cropped to 32 bits,
instead of a possible memory corruption a segmentation fault is sent as
nothing is mapped below text normally. Here is a patch for MIPS/ELF64 --
basically nothing new: copied from the Alpha's default.
2003-05-21 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
* emulparams/elf64btsmip.sh: Set TEXT_START_ADDR to 0x120000000 to
trap on pointer crops.
OK to apply?
Maciej
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
binutils-2.13.91-20030515-mips64-text_start.patch
diff -up --recursive --new-file binutils.macro/ld/emulparams/elf64btsmip.sh binutils/ld/emulparams/elf64btsmip.sh
--- binutils.macro/ld/emulparams/elf64btsmip.sh 2003-05-14 12:11:22.000000000 +0000
+++ binutils/ld/emulparams/elf64btsmip.sh 2003-05-21 07:01:42.000000000 +0000
@@ -14,4 +14,5 @@ OTHER_SECTIONS='
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
'
+TEXT_START_ADDR="0x120000000"
TEXT_DYNAMIC=