diff options
author | kib <kib@FreeBSD.org> | 2009-10-10 15:31:24 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-10-10 15:31:24 +0000 |
commit | 3547dab066949bdbc8814e75d38e8403275bd4d4 (patch) | |
tree | 7ad012f35330fb053a8b1ab1f364792ce127e7c2 | |
parent | 16ff64e8c6636314a9d07e743e481c2d58bcb7a4 (diff) | |
download | FreeBSD-src-3547dab066949bdbc8814e75d38e8403275bd4d4.zip FreeBSD-src-3547dab066949bdbc8814e75d38e8403275bd4d4.tar.gz |
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
-rw-r--r-- | sys/amd64/include/elf.h | 6 | ||||
-rw-r--r-- | sys/arm/include/elf.h | 3 | ||||
-rw-r--r-- | sys/i386/include/elf.h | 2 | ||||
-rw-r--r-- | sys/ia64/include/elf.h | 2 | ||||
-rw-r--r-- | sys/mips/include/elf.h | 2 | ||||
-rw-r--r-- | sys/powerpc/include/elf.h | 2 | ||||
-rw-r--r-- | sys/sparc64/include/elf.h | 2 | ||||
-rw-r--r-- | sys/sun4v/include/elf.h | 2 |
8 files changed, 21 insertions, 0 deletions
diff --git a/sys/amd64/include/elf.h b/sys/amd64/include/elf.h index e5c95f7..88f4398 100644 --- a/sys/amd64/include/elf.h +++ b/sys/amd64/include/elf.h @@ -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_ */ diff --git a/sys/arm/include/elf.h b/sys/arm/include/elf.h index ee2843f..0660ba6 100644 --- a/sys/arm/include/elf.h +++ b/sys/arm/include/elf.h @@ -97,4 +97,7 @@ __ElfType(Auxinfo); * value. */ #define MAGIC_TRAMP_NUMBER 0x5c000003 + +#define ET_DYN_LOAD_ADDR 0x12000 + #endif /* !_MACHINE_ELF_H_ */ diff --git a/sys/i386/include/elf.h b/sys/i386/include/elf.h index af71ab8..37ee279 100644 --- a/sys/i386/include/elf.h +++ b/sys/i386/include/elf.h @@ -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_ */ diff --git a/sys/ia64/include/elf.h b/sys/ia64/include/elf.h index 65802aa..c6a43fc 100644 --- a/sys/ia64/include/elf.h +++ b/sys/ia64/include/elf.h @@ -141,4 +141,6 @@ __ElfType(Auxinfo); #define DT_IA_64_PLT_RESERVE 0x70000000 +#define ET_DYN_LOAD_ADDR 0x2500000000000000 + #endif /* !_MACHINE_ELF_H_ */ diff --git a/sys/mips/include/elf.h b/sys/mips/include/elf.h index 3a31daa..995862c 100644 --- a/sys/mips/include/elf.h +++ b/sys/mips/include/elf.h @@ -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_ */ diff --git a/sys/powerpc/include/elf.h b/sys/powerpc/include/elf.h index 1224fbb..e01488d 100644 --- a/sys/powerpc/include/elf.h +++ b/sys/powerpc/include/elf.h @@ -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_ */ diff --git a/sys/sparc64/include/elf.h b/sys/sparc64/include/elf.h index c0fcbee..d35d736 100644 --- a/sys/sparc64/include/elf.h +++ b/sys/sparc64/include/elf.h @@ -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_ */ diff --git a/sys/sun4v/include/elf.h b/sys/sun4v/include/elf.h index c0fcbee..d35d736 100644 --- a/sys/sun4v/include/elf.h +++ b/sys/sun4v/include/elf.h @@ -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_ */ |