This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / asm-m32r / elf.h
1 #ifndef _ASM_M32R__ELF_H
2 #define _ASM_M32R__ELF_H
3
4 /*
5  * ELF-specific definitions.
6  *
7  * Copyright (C) 1999-2004, Renesas Technology Corp.
8  *      Hirokazu Takata <takata at linux-m32r.org>
9  */
10
11 #include <asm/ptrace.h>
12 #include <asm/user.h>
13 #include <asm/page.h>
14
15 /* M32R relocation types  */
16 #define R_M32R_NONE             0
17 #define R_M32R_16               1
18 #define R_M32R_32               2
19 #define R_M32R_24               3
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
25 #define R_M32R_LO16             9
26 #define R_M32R_SDA16            10
27 #ifdef OLD_TYPE
28 #define R_M32R_GOT24            11
29 #define R_M32R_26_PLTREL        12
30 #define R_M32R_GOT16_HI_ULO     13
31 #define R_M32R_GOT16_HI_SLO     14
32 #define R_M32R_GOT16_LO         15
33 #define R_M32R_GOTPC24          16
34 #define R_M32R_COPY             17
35 #define R_M32R_GLOB_DAT         18
36 #define R_M32R_JMP_SLOT         19
37 #define R_M32R_RELATIVE         20
38 #define R_M32R_GNU_VTINHERIT    21
39 #define R_M32R_GNU_VTENTRY      22
40
41 #define R_M32R_16_RELA          R_M32R_16
42 #define R_M32R_32_RELA          R_M32R_32
43 #define R_M32R_24_RELA          R_M32R_24
44 #define R_M32R_10_PCREL_RELA    R_M32R_10_PCREL
45 #define R_M32R_18_PCREL_RELA    R_M32R_18_PCREL
46 #define R_M32R_26_PCREL_RELA    R_M32R_26_PCREL
47 #define R_M32R_HI16_ULO_RELA    R_M32R_HI16_ULO
48 #define R_M32R_HI16_SLO_RELA    R_M32R_HI16_SLO
49 #define R_M32R_LO16_RELA        R_M32R_LO16
50 #define R_M32R_SDA16_RELA       R_M32R_SDA16
51 #else /* not OLD_TYPE */
52 #define R_M32R_GNU_VTINHERIT    11
53 #define R_M32R_GNU_VTENTRY      12
54
55 #define R_M32R_GOT24_SAMPLE             11 /* comflict */
56 #define R_M32R_26_PLTREL_SAMPLE 12 /* comflict */
57 #define R_M32R_GOT16_HI_ULO_SAMPLE      13
58 #define R_M32R_GOT16_HI_SLO_SAMPLE      14
59 #define R_M32R_GOT16_LO_SAMPLE          15
60 #define R_M32R_GOTPC24_SAMPLE           16
61 #define R_M32R_COPY_SAMPLE              17
62 #define R_M32R_GLOB_DAT_SAMPLE          18
63 #define R_M32R_JMP_SLOT_SAMPLE          19
64 #define R_M32R_RELATIVE_SAMPLE          20
65 #define R_M32R_GNU_VTINHERIT_SAMPLE     21
66 #define R_M32R_GNU_VTENTRY_SAMPLE       22
67
68 #define R_M32R_16_RELA          33
69 #define R_M32R_32_RELA          34
70 #define R_M32R_24_RELA          35
71 #define R_M32R_10_PCREL_RELA    36
72 #define R_M32R_18_PCREL_RELA    37
73 #define R_M32R_26_PCREL_RELA    38
74 #define R_M32R_HI16_ULO_RELA    39
75 #define R_M32R_HI16_SLO_RELA    40
76 #define R_M32R_LO16_RELA        41
77 #define R_M32R_SDA16_RELA       42
78 #define R_M32R_RELA_GNU_VTINHERIT       43
79 #define R_M32R_RELA_GNU_VTENTRY 44
80
81 #define R_M32R_GOT24            48
82 #define R_M32R_26_PLTREL        49
83 #define R_M32R_COPY             50
84 #define R_M32R_GLOB_DAT         51
85 #define R_M32R_JMP_SLOT         52
86 #define R_M32R_RELATIVE         53
87 #define R_M32R_GOTOFF           54
88 #define R_M32R_GOTPC24          55
89 #define R_M32R_GOT16_HI_ULO     56
90 #define R_M32R_GOT16_HI_SLO     57
91 #define R_M32R_GOT16_LO         58
92 #define R_M32R_GOTPC_HI_ULO     59
93 #define R_M32R_GOTPC_HI_SLO     60
94 #define R_M32R_GOTPC_LO         61
95 #endif /* not OLD_TYPE */
96
97 #define R_M32R_NUM              256
98
99 /*
100  * ELF register definitions..
101  */
102 #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
103
104 typedef unsigned long elf_greg_t;
105 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
106
107 /* We have no FP mumumu.  */
108 typedef double elf_fpreg_t;
109 typedef elf_fpreg_t elf_fpregset_t;
110
111 /*
112  * This is used to ensure we don't load something for the wrong architecture.
113  */
114 #define elf_check_arch(x) \
115         (((x)->e_machine == EM_M32R) || ((x)->e_machine == EM_CYGNUS_M32R))
116
117 /*
118  * These are used to set parameters in the core dumps.
119  */
120 #define ELF_CLASS       ELFCLASS32
121 #if defined(__LITTLE_ENDIAN)
122 #define ELF_DATA        ELFDATA2LSB
123 #elif defined(__BIG_ENDIAN)
124 #define ELF_DATA        ELFDATA2MSB
125 #else
126 #error no endian defined
127 #endif
128 #define ELF_ARCH        EM_M32R
129
130 /* r0 is set by ld.so to a pointer to a function which might be
131  * registered using 'atexit'.  This provides a mean for the dynamic
132  * linker to call DT_FINI functions for shared libraries that have
133  * been loaded before the code runs.
134  *
135  * So that we can use the same startup file with static executables,
136  * we start programs with a value of 0 to indicate that there is no
137  * such function.
138  */
139 #define ELF_PLAT_INIT(_r, load_addr)    (_r)->r0 = 0
140
141 #define USE_ELF_CORE_DUMP
142 #define ELF_EXEC_PAGESIZE       PAGE_SIZE
143
144 /*
145  * This is the location that an ET_DYN program is loaded if exec'ed.
146  * Typical use of this is to invoke "./ld.so someprog" to test out a
147  * new version of the loader.  We need to make sure that it is out of
148  * the way of the program that it will "exec", and that there is
149  * sufficient room for the brk.
150  */
151 #define ELF_ET_DYN_BASE         (TASK_SIZE / 3 * 2)
152
153 /* regs is struct pt_regs, pr_reg is elf_gregset_t (which is
154    now struct_user_regs, they are different) */
155
156 #define ELF_CORE_COPY_REGS(pr_reg, regs)  \
157         memcpy((char *)&pr_reg, (char *)&regs, sizeof (struct pt_regs));
158
159 /* This yields a mask that user programs can use to figure out what
160    instruction set this CPU supports.  */
161 #define ELF_HWCAP       (0)
162
163 /* This yields a string that ld.so will use to load implementation
164    specific libraries for optimization.  This is more specific in
165    intent than poking at uname or /proc/cpuinfo.  */
166 #define ELF_PLATFORM    (NULL)
167
168 #ifdef __KERNEL__
169 #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX)
170 #endif
171
172 #endif  /* _ASM_M32R__ELF_H */