elf.h (114349) | elf.h (114987) |
---|---|
1/*- 2 * Copyright (c) 1996-1997 John D. Polstra. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1996-1997 John D. Polstra. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/amd64/include/elf.h 114349 2003-05-01 01:05:25Z peter $ | 26 * $FreeBSD: head/sys/amd64/include/elf.h 114987 2003-05-14 04:10:49Z peter $ |
27 */ 28 29#ifndef _MACHINE_ELF_H_ 30#define _MACHINE_ELF_H_ 1 31 32/* 33 * ELF definitions for the AMD64 architecture. 34 */ 35 | 27 */ 28 29#ifndef _MACHINE_ELF_H_ 30#define _MACHINE_ELF_H_ 1 31 32/* 33 * ELF definitions for the AMD64 architecture. 34 */ 35 |
36#include <sys/elf64.h> /* Definitions common to all 64 bit architectures. */ | |
37 | 36 |
37#ifndef __ELF_WORD_SIZE |
|
38#define __ELF_WORD_SIZE 64 /* Used by <sys/elf_generic.h> */ | 38#define __ELF_WORD_SIZE 64 /* Used by <sys/elf_generic.h> */ |
39#endif 40#include <sys/elf32.h> /* Definitions common to all 32 bit architectures. */ 41#include <sys/elf64.h> /* Definitions common to all 64 bit architectures. */ |
|
39#include <sys/elf_generic.h> 40 41#define ELF_ARCH EM_X86_64 42 43#define ELF_MACHINE_OK(x) ((x) == EM_X86_64) 44 45/* 46 * Auxiliary vector entries for passing information to the interpreter. 47 * 48 * The i386 supplement to the SVR4 ABI specification names this "auxv_t", 49 * but POSIX lays claim to all symbols ending with "_t". 50 */ | 42#include <sys/elf_generic.h> 43 44#define ELF_ARCH EM_X86_64 45 46#define ELF_MACHINE_OK(x) ((x) == EM_X86_64) 47 48/* 49 * Auxiliary vector entries for passing information to the interpreter. 50 * 51 * The i386 supplement to the SVR4 ABI specification names this "auxv_t", 52 * but POSIX lays claim to all symbols ending with "_t". 53 */ |
54typedef struct { /* Auxiliary vector entry on initial stack */ 55 int a_type; /* Entry type. */ 56 union { 57 int a_val; /* Integer value. */ 58 } a_un; 59} Elf32_Auxinfo; |
|
51 | 60 |
61 |
|
52typedef struct { /* Auxiliary vector entry on initial stack */ 53 long a_type; /* Entry type. */ 54 union { 55 long a_val; /* Integer value. */ 56 void *a_ptr; /* Address. */ 57 void (*a_fcn)(void); /* Function pointer (not used). */ 58 } a_un; 59} Elf64_Auxinfo; --- 53 unchanged lines hidden (view full) --- 113#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */ 114#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */ 115#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */ 116#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */ 117 118#define R_X86_64_COUNT 16 /* Count of defined relocation types. */ 119 120/* Define "machine" characteristics */ | 62typedef struct { /* Auxiliary vector entry on initial stack */ 63 long a_type; /* Entry type. */ 64 union { 65 long a_val; /* Integer value. */ 66 void *a_ptr; /* Address. */ 67 void (*a_fcn)(void); /* Function pointer (not used). */ 68 } a_un; 69} Elf64_Auxinfo; --- 53 unchanged lines hidden (view full) --- 123#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */ 124#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */ 125#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */ 126#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */ 127 128#define R_X86_64_COUNT 16 /* Count of defined relocation types. */ 129 130/* Define "machine" characteristics */ |
121#define ELF_TARG_CLASS ELFCLASS64 | 131#if __ELF_WORD_SIZE == 32 132#define ELF_TARG_CLASS ELFCLASS32 133#else 134#define ELF_TARG_CLASS ELFCLASS64 135#endif |
122#define ELF_TARG_DATA ELFDATA2LSB 123#define ELF_TARG_MACH EM_X86_64 124#define ELF_TARG_VER 1 125 126#ifdef _KERNEL 127 128/* 129 * On the i386 we load the dynamic linker where a userland call 130 * to mmap(0, ...) would put it. The rationale behind this 131 * calculation is that it leaves room for the heap to grow to 132 * its maximum allowed size. 133 */ 134#define ELF_RTLD_ADDR(vmspace) \ 135 (round_page((vm_offset_t)(vmspace)->vm_daddr + maxdsiz)) 136 137#endif /* _KERNEL */ 138#endif /* !_MACHINE_ELF_H_ */ | 136#define ELF_TARG_DATA ELFDATA2LSB 137#define ELF_TARG_MACH EM_X86_64 138#define ELF_TARG_VER 1 139 140#ifdef _KERNEL 141 142/* 143 * On the i386 we load the dynamic linker where a userland call 144 * to mmap(0, ...) would put it. The rationale behind this 145 * calculation is that it leaves room for the heap to grow to 146 * its maximum allowed size. 147 */ 148#define ELF_RTLD_ADDR(vmspace) \ 149 (round_page((vm_offset_t)(vmspace)->vm_daddr + maxdsiz)) 150 151#endif /* _KERNEL */ 152#endif /* !_MACHINE_ELF_H_ */ |