1 #ifndef _ASM_M32R__ELF_H
2 #define _ASM_M32R__ELF_H
5 * ELF-specific definitions.
7 * Copyright (C) 1999-2004, Renesas Technology Corp.
8 * Hirokazu Takata <takata at linux-m32r.org>
11 #include <asm/ptrace.h>
15 /* M32R relocation types */
20 #define R_M32R_10_PCREL 4
21 #define R_M32R_18_PCREL 5
22 #define R_M32R_26_PCREL 6
23 #define R_M32R_HI16_ULO 7
24 #define R_M32R_HI16_SLO 8
26 #define R_M32R_SDA16 10
27 #define R_M32R_GNU_VTINHERIT 11
28 #define R_M32R_GNU_VTENTRY 12
30 #define R_M32R_16_RELA 33
31 #define R_M32R_32_RELA 34
32 #define R_M32R_24_RELA 35
33 #define R_M32R_10_PCREL_RELA 36
34 #define R_M32R_18_PCREL_RELA 37
35 #define R_M32R_26_PCREL_RELA 38
36 #define R_M32R_HI16_ULO_RELA 39
37 #define R_M32R_HI16_SLO_RELA 40
38 #define R_M32R_LO16_RELA 41
39 #define R_M32R_SDA16_RELA 42
40 #define R_M32R_RELA_GNU_VTINHERIT 43
41 #define R_M32R_RELA_GNU_VTENTRY 44
43 #define R_M32R_GOT24 48
44 #define R_M32R_26_PLTREL 49
45 #define R_M32R_COPY 50
46 #define R_M32R_GLOB_DAT 51
47 #define R_M32R_JMP_SLOT 52
48 #define R_M32R_RELATIVE 53
49 #define R_M32R_GOTOFF 54
50 #define R_M32R_GOTPC24 55
51 #define R_M32R_GOT16_HI_ULO 56
52 #define R_M32R_GOT16_HI_SLO 57
53 #define R_M32R_GOT16_LO 58
54 #define R_M32R_GOTPC_HI_ULO 59
55 #define R_M32R_GOTPC_HI_SLO 60
56 #define R_M32R_GOTPC_LO 61
58 #define R_M32R_NUM 256
61 * ELF register definitions..
63 #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
65 typedef unsigned long elf_greg_t;
66 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
68 /* We have no FP mumumu. */
69 typedef double elf_fpreg_t;
70 typedef elf_fpreg_t elf_fpregset_t;
73 * This is used to ensure we don't load something for the wrong architecture.
75 #define elf_check_arch(x) \
76 (((x)->e_machine == EM_M32R) || ((x)->e_machine == EM_CYGNUS_M32R))
79 * These are used to set parameters in the core dumps.
81 #define ELF_CLASS ELFCLASS32
82 #if defined(__LITTLE_ENDIAN)
83 #define ELF_DATA ELFDATA2LSB
84 #elif defined(__BIG_ENDIAN)
85 #define ELF_DATA ELFDATA2MSB
87 #error no endian defined
89 #define ELF_ARCH EM_M32R
91 /* r0 is set by ld.so to a pointer to a function which might be
92 * registered using 'atexit'. This provides a mean for the dynamic
93 * linker to call DT_FINI functions for shared libraries that have
94 * been loaded before the code runs.
96 * So that we can use the same startup file with static executables,
97 * we start programs with a value of 0 to indicate that there is no
100 #define ELF_PLAT_INIT(_r, load_addr) (_r)->r0 = 0
102 #define USE_ELF_CORE_DUMP
103 #define ELF_EXEC_PAGESIZE PAGE_SIZE
106 * This is the location that an ET_DYN program is loaded if exec'ed.
107 * Typical use of this is to invoke "./ld.so someprog" to test out a
108 * new version of the loader. We need to make sure that it is out of
109 * the way of the program that it will "exec", and that there is
110 * sufficient room for the brk.
112 #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
114 /* regs is struct pt_regs, pr_reg is elf_gregset_t (which is
115 now struct_user_regs, they are different) */
117 #define ELF_CORE_COPY_REGS(pr_reg, regs) \
118 memcpy((char *)pr_reg, (char *)regs, sizeof (struct pt_regs));
120 /* This yields a mask that user programs can use to figure out what
121 instruction set this CPU supports. */
122 #define ELF_HWCAP (0)
124 /* This yields a string that ld.so will use to load implementation
125 specific libraries for optimization. This is more specific in
126 intent than poking at uname or /proc/cpuinfo. */
127 #define ELF_PLATFORM (NULL)
130 #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX)
133 #endif /* _ASM_M32R__ELF_H */