#ifndef __ASM_ALPHA_ELF_H1#define __ASM_ALPHA_ELF_H23#include <asm/auxvec.h>45/* Special values for the st_other field in the symbol table. */67#define STO_ALPHA_NOPV 0x808#define STO_ALPHA_STD_GPLOAD 0x88910/*11* Alpha ELF relocation types12*/13#define R_ALPHA_NONE 0 /* No reloc */14#define R_ALPHA_REFLONG 1 /* Direct 32 bit */15#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */16#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */17#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */18#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */19#define R_ALPHA_GPDISP 6 /* Add displacement to GP */20#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */21#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */22#define R_ALPHA_SREL16 9 /* PC relative 16 bit */23#define R_ALPHA_SREL32 10 /* PC relative 32 bit */24#define R_ALPHA_SREL64 11 /* PC relative 64 bit */25#define R_ALPHA_GPRELHIGH 17 /* GP relative 32 bit, high 16 bits */26#define R_ALPHA_GPRELLOW 18 /* GP relative 32 bit, low 16 bits */27#define R_ALPHA_GPREL16 19 /* GP relative 16 bit */28#define R_ALPHA_COPY 24 /* Copy symbol at runtime */29#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */30#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */31#define R_ALPHA_RELATIVE 27 /* Adjust by program base */32#define R_ALPHA_BRSGP 2833#define R_ALPHA_TLSGD 2934#define R_ALPHA_TLS_LDM 3035#define R_ALPHA_DTPMOD64 3136#define R_ALPHA_GOTDTPREL 3237#define R_ALPHA_DTPREL64 3338#define R_ALPHA_DTPRELHI 3439#define R_ALPHA_DTPRELLO 3540#define R_ALPHA_DTPREL16 3641#define R_ALPHA_GOTTPREL 3742#define R_ALPHA_TPREL64 3843#define R_ALPHA_TPRELHI 3944#define R_ALPHA_TPRELLO 4045#define R_ALPHA_TPREL16 414647#define SHF_ALPHA_GPREL 0x100000004849/* Legal values for e_flags field of Elf64_Ehdr. */5051#define EF_ALPHA_32BIT 1 /* All addresses are below 2GB */5253/*54* ELF register definitions..55*/5657/*58* The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.59* I have no idea why that is so. For now, we just leave it at 3360* (32 general regs + processor status word).61*/62#define ELF_NGREG 3363#define ELF_NFPREG 326465typedef unsigned long elf_greg_t;66typedef elf_greg_t elf_gregset_t[ELF_NGREG];6768typedef double elf_fpreg_t;69typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];7071/*72* This is used to ensure we don't load something for the wrong architecture.73*/74#define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)7576/*77* These are used to set parameters in the core dumps.78*/79#define ELF_CLASS ELFCLASS6480#define ELF_DATA ELFDATA2LSB81#define ELF_ARCH EM_ALPHA8283#define ELF_EXEC_PAGESIZE 81928485/* This is the location that an ET_DYN program is loaded if exec'ed. Typical86use of this is to invoke "./ld.so someprog" to test out a new version of87the loader. We need to make sure that it is out of the way of the program88that it will "exec", and that there is sufficient room for the brk. */8990#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000)9192/* $0 is set by ld.so to a pointer to a function which might be93registered using atexit. This provides a mean for the dynamic94linker to call DT_FINI functions for shared libraries that have95been loaded before the code runs.9697So that we can use the same startup file with static executables,98we start programs with a value of 0 to indicate that there is no99such function. */100101#define ELF_PLAT_INIT(_r, load_addr) _r->r0 = 0102103/* The registers are laid out in pt_regs for PAL and syscall104convenience. Re-order them for the linear elf_gregset_t. */105106struct pt_regs;107struct thread_info;108struct task_struct;109extern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt,110struct thread_info *ti);111#define ELF_CORE_COPY_REGS(DEST, REGS) \112dump_elf_thread(DEST, REGS, current_thread_info());113114/* Similar, but for a thread other than current. */115116extern int dump_elf_task(elf_greg_t *dest, struct task_struct *task);117#define ELF_CORE_COPY_TASK_REGS(TASK, DEST) \118dump_elf_task(*(DEST), TASK)119120/* Similar, but for the FP registers. */121122extern int dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task);123#define ELF_CORE_COPY_FPREGS(TASK, DEST) \124dump_elf_task_fp(*(DEST), TASK)125126/* This yields a mask that user programs can use to figure out what127instruction set this CPU supports. This is trivial on Alpha,128but not so on other machines. */129130#define ELF_HWCAP (~amask(-1))131132/* This yields a string that ld.so will use to load implementation133specific libraries for optimization. This is more specific in134intent than poking at uname or /proc/cpuinfo. */135136#define ELF_PLATFORM \137({ \138enum implver_enum i_ = implver(); \139( i_ == IMPLVER_EV4 ? "ev4" \140: i_ == IMPLVER_EV5 \141? (amask(AMASK_BWX) ? "ev5" : "ev56") \142: amask (AMASK_CIX) ? "ev6" : "ev67"); \143})144145#define SET_PERSONALITY(EX) \146set_personality(((EX).e_flags & EF_ALPHA_32BIT) \147? PER_LINUX_32BIT : PER_LINUX)148149extern int alpha_l1i_cacheshape;150extern int alpha_l1d_cacheshape;151extern int alpha_l2_cacheshape;152extern int alpha_l3_cacheshape;153154/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */155#define ARCH_DLINFO \156do { \157NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape); \158NEW_AUX_ENT(AT_L1D_CACHESHAPE, alpha_l1d_cacheshape); \159NEW_AUX_ENT(AT_L2_CACHESHAPE, alpha_l2_cacheshape); \160NEW_AUX_ENT(AT_L3_CACHESHAPE, alpha_l3_cacheshape); \161} while (0)162163#endif /* __ASM_ALPHA_ELF_H */164165166