|
16 | 16 | #ifndef __ASM_ELF_H |
17 | 17 | #define __ASM_ELF_H |
18 | 18 |
|
19 | | -#include <asm/errno.h> |
20 | 19 | #include <asm/hwcap.h> |
21 | 20 |
|
22 | 21 | /* |
@@ -136,11 +135,7 @@ extern unsigned long randomize_et_dyn(unsigned long base); |
136 | 135 | */ |
137 | 136 | #define ELF_PLAT_INIT(_r, load_addr) (_r)->regs[0] = 0 |
138 | 137 |
|
139 | | -#define SET_PERSONALITY(ex) \ |
140 | | -do { \ |
141 | | - clear_thread_flag(TIF_AARCH32); \ |
142 | | - clear_thread_flag(TIF_32BIT); \ |
143 | | -} while (0) |
| 138 | +#define SET_PERSONALITY(ex) clear_thread_flag(TIF_32BIT); |
144 | 139 |
|
145 | 140 | #define ARCH_DLINFO \ |
146 | 141 | do { \ |
@@ -176,100 +171,23 @@ extern unsigned long arch_randomize_brk(struct mm_struct *mm); |
176 | 171 |
|
177 | 172 | #define COMPAT_ELF_ET_DYN_BASE (2 * TASK_SIZE_32 / 3) |
178 | 173 |
|
179 | | -#ifdef CONFIG_AARCH32_EL0 |
180 | | - |
181 | 174 | /* AArch32 registers. */ |
182 | | -#define COMPAT_A32_ELF_NGREG 18 |
183 | | -typedef unsigned int compat_a32_elf_greg_t; |
184 | | -typedef compat_a32_elf_greg_t compat_a32_elf_gregset_t[COMPAT_A32_ELF_NGREG]; |
| 175 | +#define COMPAT_ELF_NGREG 18 |
| 176 | +typedef unsigned int compat_elf_greg_t; |
| 177 | +typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; |
185 | 178 |
|
186 | 179 | /* AArch32 EABI. */ |
187 | 180 | #define EF_ARM_EABI_MASK 0xff000000 |
188 | | -#define compat_a32_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \ |
| 181 | +#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \ |
189 | 182 | ((x)->e_flags & EF_ARM_EABI_MASK)) |
190 | 183 |
|
191 | 184 | #define compat_start_thread compat_start_thread |
192 | | -#define COMPAT_A32_SET_PERSONALITY(ex) \ |
193 | | -do { \ |
194 | | - set_thread_flag(TIF_AARCH32); \ |
195 | | - set_thread_flag(TIF_32BIT); \ |
196 | | -} while (0) |
197 | | -#define COMPAT_A32_ARCH_DLINFO do {} while (0) |
| 185 | +#define COMPAT_SET_PERSONALITY(ex) set_thread_flag(TIF_32BIT); |
| 186 | +#define COMPAT_ARCH_DLINFO |
198 | 187 | extern int aarch32_setup_vectors_page(struct linux_binprm *bprm, |
199 | 188 | int uses_interp); |
200 | | - |
201 | | -#else |
202 | | -typedef elf_greg_t compat_elf_greg_t; |
203 | | -typedef elf_gregset_t compat_elf_gregset_t; |
204 | | -#define compat_a32_elf_check_arch(x) 0 |
205 | | -#define COMPAT_A32_SET_PERSONALITY(ex) do {} while (0) |
206 | | -#define COMPAT_A32_ARCH_DLINFO do {} while (0) |
207 | | -static inline int aarch32_setup_vectors_page(struct linux_binprm *bprm, |
208 | | - int uses_interp) |
209 | | -{ |
210 | | - return -EINVAL; |
211 | | -} |
212 | | -#endif |
213 | | - |
214 | | -/* |
215 | | - * If ILP32 is turned on, we want to define the compat_elf_greg_t to the non compat |
216 | | - * one and define PR_REG_SIZE/PRSTATUS_SIZE/SET_PR_FPVALID so we pick up the correct |
217 | | - * ones for AARCH32. |
218 | | - */ |
219 | | -#ifdef CONFIG_ARM64_ILP32 |
220 | | -typedef elf_greg_t compat_elf_greg_t; |
221 | | -typedef elf_gregset_t compat_elf_gregset_t; |
222 | | -#define COMPAT_PR_REG_SIZE(S) (is_a32_compat_task() ? 72 : 272) |
223 | | -#define COMPAT_PRSTATUS_SIZE(S) (is_a32_compat_task() ? 124 : 352) |
224 | | -#define COMPAT_SET_PR_FPVALID(S, V) \ |
225 | | -do { \ |
226 | | - *(int *) (((void *) &((S)->pr_reg)) + PR_REG_SIZE((S)->pr_reg)) = (V); \ |
227 | | -} while (0) |
228 | | -#else |
229 | | -typedef compat_a32_elf_greg_t compat_elf_greg_t; |
230 | | -typedef compat_a32_elf_gregset_t compat_elf_gregset_t; |
231 | | -#endif |
232 | | - |
233 | | -#ifdef CONFIG_ARM64_ILP32 |
234 | | -#define compat_ilp32_elf_check_arch(x) ((x)->e_machine == EM_AARCH64) |
235 | | -#define COMPAT_ILP32_SET_PERSONALITY(ex) \ |
236 | | -do { \ |
237 | | - clear_thread_flag(TIF_AARCH32); \ |
238 | | - set_thread_flag(TIF_32BIT); \ |
239 | | -} while (0) |
240 | | -#define COMPAT_ILP32_ARCH_DLINFO \ |
241 | | -do { \ |
242 | | - NEW_AUX_ENT(AT_SYSINFO_EHDR, \ |
243 | | - (elf_addr_t)(long)current->mm->context.vdso); \ |
244 | | -} while (0) |
245 | | -#else |
246 | | -#define compat_ilp32_elf_check_arch(x) 0 |
247 | | -#define COMPAT_ILP32_SET_PERSONALITY(ex) do {} while (0) |
248 | | -#define COMPAT_ILP32_ARCH_DLINFO do {} while (0) |
249 | | -#endif |
250 | | - |
251 | | -#define compat_elf_check_arch(x) (compat_a32_elf_check_arch(x) || compat_ilp32_elf_check_arch(x)) |
252 | | -#define COMPAT_SET_PERSONALITY(ex) \ |
253 | | -do { \ |
254 | | - if (compat_a32_elf_check_arch(&ex)) \ |
255 | | - COMPAT_A32_SET_PERSONALITY(ex); \ |
256 | | - else \ |
257 | | - COMPAT_ILP32_SET_PERSONALITY(ex); \ |
258 | | -} while (0) |
259 | | - |
260 | | -/* ILP32 uses the "LP64-like" vdso pages */ |
261 | | -#define compat_arch_setup_additional_pages \ |
262 | | - (is_a32_compat_task() \ |
263 | | - ? &aarch32_setup_vectors_page \ |
264 | | - : &(arch_setup_additional_pages)) |
265 | | - |
266 | | -#define COMPAT_ARCH_DLINFO \ |
267 | | -do { \ |
268 | | - if (is_a32_compat_task()) \ |
269 | | - COMPAT_A32_ARCH_DLINFO; \ |
270 | | - else \ |
271 | | - COMPAT_ILP32_ARCH_DLINFO; \ |
272 | | -} while (0) |
| 189 | +#define compat_arch_setup_additional_pages \ |
| 190 | + aarch32_setup_vectors_page |
273 | 191 |
|
274 | 192 | #endif /* CONFIG_COMPAT */ |
275 | 193 |
|
|
0 commit comments