blob: 8a8246d039363f0bd60c43584050de3e620caa1f [file] [log] [blame]
Bodo Stroesserdbc35cc72005-05-05 16:15:35 -07001/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6#ifndef __UM_ELF_X86_64_H
7#define __UM_ELF_X86_64_H
8
9#include <asm/user.h>
10
Jeff Dikeba9950c2005-05-20 13:59:07 -070011/* x86-64 relocation types, taken from asm-x86_64/elf.h */
12#define R_X86_64_NONE 0 /* No reloc */
13#define R_X86_64_64 1 /* Direct 64 bit */
14#define R_X86_64_PC32 2 /* PC relative 32 bit signed */
15#define R_X86_64_GOT32 3 /* 32 bit GOT entry */
16#define R_X86_64_PLT32 4 /* 32 bit PLT address */
17#define R_X86_64_COPY 5 /* Copy symbol at runtime */
18#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
19#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */
20#define R_X86_64_RELATIVE 8 /* Adjust by program base */
21#define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative
22 offset to GOT */
23#define R_X86_64_32 10 /* Direct 32 bit zero extended */
24#define R_X86_64_32S 11 /* Direct 32 bit sign extended */
25#define R_X86_64_16 12 /* Direct 16 bit zero extended */
26#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */
27#define R_X86_64_8 14 /* Direct 8 bit sign extended */
28#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */
29
30#define R_X86_64_NUM 16
31
Bodo Stroesserdbc35cc72005-05-05 16:15:35 -070032typedef unsigned long elf_greg_t;
33
34#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
35typedef elf_greg_t elf_gregset_t[ELF_NGREG];
36
37typedef struct { } elf_fpregset_t;
38
39/*
40 * This is used to ensure we don't load something for the wrong architecture.
41 */
42#define elf_check_arch(x) \
43 ((x)->e_machine == EM_X86_64)
44
45#define ELF_CLASS ELFCLASS64
46#define ELF_DATA ELFDATA2LSB
47#define ELF_ARCH EM_X86_64
48
49#define ELF_PLAT_INIT(regs, load_addr) do { \
50 PT_REGS_RBX(regs) = 0; \
51 PT_REGS_RCX(regs) = 0; \
52 PT_REGS_RDX(regs) = 0; \
53 PT_REGS_RSI(regs) = 0; \
54 PT_REGS_RDI(regs) = 0; \
55 PT_REGS_RBP(regs) = 0; \
56 PT_REGS_RAX(regs) = 0; \
57 PT_REGS_R8(regs) = 0; \
58 PT_REGS_R9(regs) = 0; \
59 PT_REGS_R10(regs) = 0; \
60 PT_REGS_R11(regs) = 0; \
61 PT_REGS_R12(regs) = 0; \
62 PT_REGS_R13(regs) = 0; \
63 PT_REGS_R14(regs) = 0; \
64 PT_REGS_R15(regs) = 0; \
65} while (0)
66
67#ifdef TIF_IA32 /* XXX */
Jeff Dikeba9950c2005-05-20 13:59:07 -070068#error XXX, indeed
69 clear_thread_flag(TIF_IA32);
Bodo Stroesserdbc35cc72005-05-05 16:15:35 -070070#endif
71
72#define USE_ELF_CORE_DUMP
73#define ELF_EXEC_PAGESIZE 4096
74
75#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
76
77extern long elf_aux_hwcap;
78#define ELF_HWCAP (elf_aux_hwcap)
79
80#define ELF_PLATFORM "x86_64"
81
82#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
83
84#endif
85
86/*
87 * Overrides for Emacs so that we follow Linus's tabbing style.
88 * Emacs will notice this stuff at the end of the file and automatically
89 * adjust the settings for this buffer only. This must remain at the end
90 * of the file.
91 * ---------------------------------------------------------------------------
92 * Local variables:
93 * c-file-style: "linux"
94 * End:
95 */