Don't allow text relocations on 64-bit.

I've also updated our <sys/exec_elf.h> to match upstream.

Change-Id: I52f9fce3167541811208d273ff23ceaa112f7135
This commit is contained in:
Elliott Hughes
2013-10-28 14:19:05 -07:00
parent 3ec5d8954b
commit e4d792adb8
4 changed files with 65 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: exec_elf.h,v 1.126 2012/08/05 01:43:59 matt Exp $ */
/* $NetBSD: exec_elf.h,v 1.129 2013/09/10 16:24:02 matt Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -429,6 +429,13 @@ typedef struct {
#define SHT_HIOS 0x6fffffff
#define SHT_LOPROC 0x70000000 /* Processor-specific range */
#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */
#define SHT_ARM_EXIDX 0x70000001 /* exception index table */
#define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking
* pre-emption map */
#define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility
* attributes */
#define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details */
#define SHT_ARM_OVERLAYSECTION 0x70000005
#define SHT_HIPROC 0x7fffffff
#define SHT_LOUSER 0x80000000 /* Application-specific range */
#define SHT_HIUSER 0xffffffff
@@ -668,7 +675,12 @@ typedef struct {
#define DT_FINI_ARRAY 26 /* Size, in bytes, of DT_INIT_ARRAY array */
#define DT_INIT_ARRAYSZ 27 /* Address of termination function array */
#define DT_FINI_ARRAYSZ 28 /* Size, in bytes, of DT_FINI_ARRAY array*/
#define DT_NUM 29
#define DT_RUNPATH 29 /* overrides DT_RPATH */
#define DT_FLAGS 30 /* Encodes ORIGIN, SYMBOLIC, TEXTREL, BIND_NOW, STATIC_TLS */
#define DT_ENCODING 31 /* ??? */
#define DT_PREINIT_ARRAY 32 /* Address of pre-init function array */
#define DT_PREINIT_ARRAYSZ 33 /* Size, in bytes, of DT_PREINIT_ARRAY array */
#define DT_NUM 34
#define DT_LOOS 0x60000000 /* Operating system specific range */
#define DT_VERSYM 0x6ffffff0 /* Symbol versions */
@@ -802,7 +814,7 @@ typedef struct {
* GNU-specific note type: Build ID generated by ld
* name: GNU\0
* desc:
* word[0..4] SHA1 [default]
* word[0..4] SHA1 [default]
* or
* word[0..3] md5 or uuid
* descsz: 16 or 20
@@ -829,7 +841,7 @@ typedef struct {
/* SuSE-specific note type: version
* name: SuSE\0\0\0\0
* namesz: 8
* desc:
* desc:
* word[0] = VVTTMMmm
*
* V = version of following data
@@ -848,7 +860,7 @@ typedef struct {
/* NetBSD-specific note type: Emulation name.
* name: NetBSD\0\0
* namesz: 8
* desc:
* desc:
* word[0]: MMmmrrpp00
*
* M = major version
@@ -864,7 +876,7 @@ typedef struct {
/* NetBSD-specific note name */
#define ELF_NOTE_NETBSD_NAME "NetBSD\0\0"
/* NetBSD-specific note type: Checksum.
/* NetBSD-specific note type: Checksum.
* There should be 1 NOTE per PT_LOAD section.
* name: ???
* namesz: ???
@@ -953,6 +965,20 @@ struct netbsd_elfcore_procinfo {
int32_t cpi_siglwp; /* LWP target of killing signal */
};
/*
* NetBSD-specific note type: MACHINE_ARCH.
* There should be 1 NOTE per executable.
* name: NetBSD\0
* namesz: 7
* desc: string
* descsz: variable
*/
#define ELF_NOTE_TYPE_MARCH_TAG 5
/* NetBSD-specific note name and description sizes */
#define ELF_NOTE_MARCH_NAMESZ ELF_NOTE_NETBSD_NAMESZ
/* NetBSD-specific note name */
#define ELF_NOTE_MARCH_NAME ELF_NOTE_NETBSD_NAME
#if !defined(ELFSIZE) && defined(ARCH_ELFSIZE)
#define ELFSIZE ARCH_ELFSIZE
#endif
@@ -1067,7 +1093,7 @@ typedef struct {
#define SYMINFO_NUM 2
/*
* These constants are used for Elf32_Verdef struct's version number.
* These constants are used for Elf32_Verdef struct's version number.
*/
#define VER_DEF_NONE 0
#define VER_DEF_CURRENT 1
@@ -1078,7 +1104,7 @@ typedef struct {
#define VER_DEF_IDX(x) VER_NDX(x)
/*
* These constants are used for Elf32_Verdef struct's vd_flags.
* These constants are used for Elf32_Verdef struct's vd_flags.
*/
#define VER_FLG_BASE 0x1
#define VER_FLG_WEAK 0x2
@@ -1091,7 +1117,7 @@ typedef struct {
#define VER_NDX_GIVEN 2
/*
* These constants are used for Elf32_Verneed struct's version number.
* These constants are used for Elf32_Verneed struct's version number.
*/
#define VER_NEED_NONE 0
#define VER_NEED_CURRENT 1