| 1 |
|
| 2 | #ifndef __ASM_ALPHA_ELF_H
|
| 3 | #define __ASM_ALPHA_ELF_H
|
| 4 |
|
| 5 | #include <asm/auxvec.h>
|
| 6 | #include <asm/special_insns.h>
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 | #define STO_ALPHA_NOPV 0x80
|
| 11 | #define STO_ALPHA_STD_GPLOAD 0x88
|
| 12 |
|
| 13 | |
| 14 | * Alpha ELF relocation types
|
| 15 |
|
| 16 | #define R_ALPHA_NONE 0
|
| 17 | #define R_ALPHA_REFLONG 1
|
| 18 | #define R_ALPHA_REFQUAD 2
|
| 19 | #define R_ALPHA_GPREL32 3
|
| 20 | #define R_ALPHA_LITERAL 4
|
| 21 | #define R_ALPHA_LITUSE 5
|
| 22 | #define R_ALPHA_GPDISP 6
|
| 23 | #define R_ALPHA_BRADDR 7
|
| 24 | #define R_ALPHA_HINT 8
|
| 25 | #define R_ALPHA_SREL16 9
|
| 26 | #define R_ALPHA_SREL32 10
|
| 27 | #define R_ALPHA_SREL64 11
|
| 28 | #define R_ALPHA_GPRELHIGH 17
|
| 29 | #define R_ALPHA_GPRELLOW 18
|
| 30 | #define R_ALPHA_GPREL16 19
|
| 31 | #define R_ALPHA_COPY 24
|
| 32 | #define R_ALPHA_GLOB_DAT 25
|
| 33 | #define R_ALPHA_JMP_SLOT 26
|
| 34 | #define R_ALPHA_RELATIVE 27
|
| 35 | #define R_ALPHA_BRSGP 28
|
| 36 | #define R_ALPHA_TLSGD 29
|
| 37 | #define R_ALPHA_TLS_LDM 30
|
| 38 | #define R_ALPHA_DTPMOD64 31
|
| 39 | #define R_ALPHA_GOTDTPREL 32
|
| 40 | #define R_ALPHA_DTPREL64 33
|
| 41 | #define R_ALPHA_DTPRELHI 34
|
| 42 | #define R_ALPHA_DTPRELLO 35
|
| 43 | #define R_ALPHA_DTPREL16 36
|
| 44 | #define R_ALPHA_GOTTPREL 37
|
| 45 | #define R_ALPHA_TPREL64 38
|
| 46 | #define R_ALPHA_TPRELHI 39
|
| 47 | #define R_ALPHA_TPRELLO 40
|
| 48 | #define R_ALPHA_TPREL16 41
|
| 49 |
|
| 50 | #define SHF_ALPHA_GPREL 0x10000000
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 | #define EF_ALPHA_32BIT 1
|
| 55 |
|
| 56 | #define CORE_DUMP_USE_REGSET 1
|
| 57 | |
| 58 | * ELF register definitions..
|
| 59 |
|
| 60 |
|
| 61 | |
| 62 | * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
|
| 63 | * I have no idea why that is so. For now, we just leave it at 33
|
| 64 | * (32 general regs + processor status word).
|
| 65 |
|
| 66 | #define ELF_NGREG 33
|
| 67 | #define ELF_NFPREG 32
|
| 68 |
|
| 69 | typedef unsigned long elf_greg_t;
|
| 70 | typedef elf_greg_t elf_gregset_t[ELF_NGREG];
|
| 71 |
|
| 72 | typedef double elf_fpreg_t;
|
| 73 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
|
| 74 |
|
| 75 | |
| 76 | * This is used to ensure we don't load something for the wrong architecture.
|
| 77 |
|
| 78 | #define elf_check_arch(x) (((x)->e_machine == EM_ALPHA) && !((x)->e_flags & EF_ALPHA_32BIT))
|
| 79 |
|
| 80 | |
| 81 | * These are used to set parameters in the core dumps.
|
| 82 |
|
| 83 | #define ELF_CLASS ELFCLASS64
|
| 84 | #define ELF_DATA ELFDATA2LSB
|
| 85 | #define ELF_ARCH EM_ALPHA
|
| 86 |
|
| 87 | #define ELF_EXEC_PAGESIZE 8192
|
| 88 |
|
| 89 | |
| 90 | use of this is to invoke "./ld.so someprog" to test out a new version of
|
| 91 | the loader. We need to make sure that it is out of the way of the program
|
| 92 | that it will "exec", and that there is sufficient room for the brk.
|
| 93 |
|
| 94 | #define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000)
|
| 95 |
|
| 96 | |
| 97 | registered using atexit. This provides a mean for the dynamic
|
| 98 | linker to call DT_FINI functions for shared libraries that have
|
| 99 | been loaded before the code runs.
|
| 100 |
|
| 101 | So that we can use the same startup file with static executables,
|
| 102 | we start programs with a value of 0 to indicate that there is no
|
| 103 | such function.
|
| 104 |
|
| 105 | #define ELF_PLAT_INIT(_r, load_addr) _r->r0 = 0
|
| 106 |
|
| 107 | |
| 108 | convenience. Re-order them for the linear elf_gregset_t.
|
| 109 |
|
| 110 | struct pt_regs;
|
| 111 | struct thread_info;
|
| 112 | struct task_struct;
|
| 113 | extern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt,
|
| 114 | struct thread_info *ti);
|
| 115 | #define ELF_CORE_COPY_REGS(DEST, REGS) \
|
| 116 | dump_elf_thread(DEST, REGS, current_thread_info());
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 | extern int dump_elf_task(elf_greg_t *dest, struct task_struct *task);
|
| 121 | #define ELF_CORE_COPY_TASK_REGS(TASK, DEST) \
|
| 122 | dump_elf_task(*(DEST), TASK)
|
| 123 |
|
| 124 | |
| 125 | instruction set this CPU supports. This is trivial on Alpha,
|
| 126 | but not so on other machines.
|
| 127 |
|
| 128 | #define ELF_HWCAP (~amask(-1))
|
| 129 |
|
| 130 | |
| 131 | specific libraries for optimization. This is more specific in
|
| 132 | intent than poking at uname or /proc/cpuinfo.
|
| 133 |
|
| 134 | #define ELF_PLATFORM \
|
| 135 | ({ \
|
| 136 | enum implver_enum i_ = implver(); \
|
| 137 | ( i_ == IMPLVER_EV5 ? "ev56" \
|
| 138 | : amask (AMASK_CIX) ? "ev6" : "ev67"); \
|
| 139 | })
|
| 140 |
|
| 141 | extern int alpha_l1i_cacheshape;
|
| 142 | extern int alpha_l1d_cacheshape;
|
| 143 | extern int alpha_l2_cacheshape;
|
| 144 | extern int alpha_l3_cacheshape;
|
| 145 |
|
| 146 |
|
| 147 | #define ARCH_DLINFO \
|
| 148 | do { \
|
| 149 | NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape); \
|
| 150 | NEW_AUX_ENT(AT_L1D_CACHESHAPE, alpha_l1d_cacheshape); \
|
| 151 | NEW_AUX_ENT(AT_L2_CACHESHAPE, alpha_l2_cacheshape); \
|
| 152 | NEW_AUX_ENT(AT_L3_CACHESHAPE, alpha_l3_cacheshape); \
|
| 153 | } while (0)
|
| 154 |
|
| 155 | #endif
|