Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Oct 2009 15:31:24 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197933 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include
Message-ID:  <200910101531.n9AFVOLI085794@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Oct 10 15:31:24 2009
New Revision: 197933
URL: http://svn.freebsd.org/changeset/base/197933

Log:
  Define architectural load bases for PIE binaries. Addresses were selected
  by looking at the bases used for non-relocatable executables by gnu ld(1),
  and adjusting it slightly.
  
  Discussed with:	bz
  Reviewed by:	kan
  Tested by:	bz (i386, amd64), bsam (linux)
  MFC after:	some time

Modified:
  head/sys/amd64/include/elf.h
  head/sys/arm/include/elf.h
  head/sys/i386/include/elf.h
  head/sys/ia64/include/elf.h
  head/sys/mips/include/elf.h
  head/sys/powerpc/include/elf.h
  head/sys/sparc64/include/elf.h
  head/sys/sun4v/include/elf.h

Modified: head/sys/amd64/include/elf.h
==============================================================================
--- head/sys/amd64/include/elf.h	Sat Oct 10 15:28:52 2009	(r197932)
+++ head/sys/amd64/include/elf.h	Sat Oct 10 15:31:24 2009	(r197933)
@@ -106,4 +106,10 @@ __ElfType(Auxinfo);
 #define	ELF_TARG_MACH	EM_X86_64
 #define	ELF_TARG_VER	1
 
+#if __ELF_WORD_SIZE == 32
+#define	ET_DYN_LOAD_ADDR 0x01001000
+#else
+#define	ET_DYN_LOAD_ADDR 0x01021000
+#endif
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: head/sys/arm/include/elf.h
==============================================================================
--- head/sys/arm/include/elf.h	Sat Oct 10 15:28:52 2009	(r197932)
+++ head/sys/arm/include/elf.h	Sat Oct 10 15:31:24 2009	(r197933)
@@ -97,4 +97,7 @@ __ElfType(Auxinfo);
  * value.
  */
 #define MAGIC_TRAMP_NUMBER	0x5c000003
+
+#define	ET_DYN_LOAD_ADDR 0x12000
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: head/sys/i386/include/elf.h
==============================================================================
--- head/sys/i386/include/elf.h	Sat Oct 10 15:28:52 2009	(r197932)
+++ head/sys/i386/include/elf.h	Sat Oct 10 15:31:24 2009	(r197933)
@@ -105,4 +105,6 @@ __ElfType(Auxinfo);
 #define	ELF_TARG_MACH	EM_386
 #define	ELF_TARG_VER	1
 
+#define	ET_DYN_LOAD_ADDR 0x01001000
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: head/sys/ia64/include/elf.h
==============================================================================
--- head/sys/ia64/include/elf.h	Sat Oct 10 15:28:52 2009	(r197932)
+++ head/sys/ia64/include/elf.h	Sat Oct 10 15:31:24 2009	(r197933)
@@ -141,4 +141,6 @@ __ElfType(Auxinfo);
 
 #define	DT_IA_64_PLT_RESERVE	0x70000000
 
+#define	ET_DYN_LOAD_ADDR 0x2500000000000000
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: head/sys/mips/include/elf.h
==============================================================================
--- head/sys/mips/include/elf.h	Sat Oct 10 15:28:52 2009	(r197932)
+++ head/sys/mips/include/elf.h	Sat Oct 10 15:31:24 2009	(r197933)
@@ -250,4 +250,6 @@ __ElfType(Auxinfo);
 
 #define	AT_COUNT	16	/* Count of defined aux entry types. */
 
+#define	ET_DYN_LOAD_ADDR 0x0120000
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: head/sys/powerpc/include/elf.h
==============================================================================
--- head/sys/powerpc/include/elf.h	Sat Oct 10 15:28:52 2009	(r197932)
+++ head/sys/powerpc/include/elf.h	Sat Oct 10 15:31:24 2009	(r197933)
@@ -96,4 +96,6 @@ __ElfType(Auxinfo);
 #define	ELF_TARG_MACH	EM_PPC
 #define	ELF_TARG_VER	1
 
+#define	ET_DYN_LOAD_ADDR 0x01010000
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: head/sys/sparc64/include/elf.h
==============================================================================
--- head/sys/sparc64/include/elf.h	Sat Oct 10 15:28:52 2009	(r197932)
+++ head/sys/sparc64/include/elf.h	Sat Oct 10 15:31:24 2009	(r197933)
@@ -97,4 +97,6 @@ __ElfType(Auxinfo);
 #define	ELF_TARG_MACH	ELF_ARCH
 #define	ELF_TARG_VER	1
 
+#define	ET_DYN_LOAD_ADDR 0x150000000
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: head/sys/sun4v/include/elf.h
==============================================================================
--- head/sys/sun4v/include/elf.h	Sat Oct 10 15:28:52 2009	(r197932)
+++ head/sys/sun4v/include/elf.h	Sat Oct 10 15:31:24 2009	(r197933)
@@ -97,4 +97,6 @@ __ElfType(Auxinfo);
 #define	ELF_TARG_MACH	ELF_ARCH
 #define	ELF_TARG_VER	1
 
+#define	ET_DYN_LOAD_ADDR 0x150000000
+
 #endif /* !_MACHINE_ELF_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910101531.n9AFVOLI085794>