1 #ifndef _ASM_X86_ELF_H 2 #define _ASM_X86_ELF_H 3 4 /* 5 * ELF register definitions.. 6 */ 7 8 #include <asm/ptrace.h> 9 #include <asm/user.h> 10 #include <asm/auxvec.h> 11 12 typedef unsigned long elf_greg_t; 13 14 #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) 15 typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 16 17 typedef struct user_i387_struct elf_fpregset_t; 18 19 #ifdef __i386__ 20 21 typedef struct user_fxsr_struct elf_fpxregset_t; 22 23 #define R_386_NONE 0 24 #define R_386_32 1 25 #define R_386_PC32 2 26 #define R_386_GOT32 3 27 #define R_386_PLT32 4 28 #define R_386_COPY 5 29 #define R_386_GLOB_DAT 6 30 #define R_386_JMP_SLOT 7 31 #define R_386_RELATIVE 8 32 #define R_386_GOTOFF 9 33 #define R_386_GOTPC 10 34 #define R_386_NUM 11 35 36 /* 37 * These are used to set parameters in the core dumps. 38 */ 39 #define ELF_CLASS ELFCLASS32 40 #define ELF_DATA ELFDATA2LSB 41 #define ELF_ARCH EM_386 42 43 #else 44 45 /* x86-64 relocation types */ 46 #define R_X86_64_NONE 0 /* No reloc */ 47 #define R_X86_64_64 1 /* Direct 64 bit */ 48 #define R_X86_64_PC32 2 /* PC relative 32 bit signed */ 49 #define R_X86_64_GOT32 3 /* 32 bit GOT entry */ 50 #define R_X86_64_PLT32 4 /* 32 bit PLT address */ 51 #define R_X86_64_COPY 5 /* Copy symbol at runtime */ 52 #define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ 53 #define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ 54 #define R_X86_64_RELATIVE 8 /* Adjust by program base */ 55 #define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative 56 offset to GOT */ 57 #define R_X86_64_32 10 /* Direct 32 bit zero extended */ 58 #define R_X86_64_32S 11 /* Direct 32 bit sign extended */ 59 #define R_X86_64_16 12 /* Direct 16 bit zero extended */ 60 #define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ 61 #define R_X86_64_8 14 /* Direct 8 bit sign extended */ 62 #define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ 63 64 #define R_X86_64_NUM 16 65 66 /* 67 * These are used to set parameters in the core dumps. 68 */ 69 #define ELF_CLASS ELFCLASS64 70 #define ELF_DATA ELFDATA2LSB 71 #define ELF_ARCH EM_X86_64 72 73 #endif 74 75 76 #endif 77