| 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or modify |
| 3 | * it under the terms of the GNU General Public License version 2 as |
| 4 | * published by the Free Software Foundation, or (at your option) any |
| 5 | * later version. See the COPYING file in the top-level directory. |
| 6 | */ |
| 7 | |
| 8 | #ifndef I386_TARGET_ELF_H |
| 9 | #define I386_TARGET_ELF_H |
| 10 | |
| 11 | #include "target_ptrace.h" |
| 12 | |
| 13 | #define ELF_CLASS ELFCLASS32 |
| 14 | #define ELF_MACHINE EM_386 |
| 15 | #define EXSTACK_DEFAULT true |
| 16 | #define VDSO_HEADER "vdso.c.inc" |
| 17 | |
| 18 | #define HAVE_ELF_HWCAP 1 |
| 19 | #define HAVE_ELF_PLATFORM 1 |
| 20 | #define HAVE_ELF_CORE_DUMP 1 |
| 21 | |
| 22 | /* |
| 23 | * See linux kernel: arch/x86/include/asm/elf.h, where elf_gregset_t |
| 24 | * is mapped to struct user_regs_struct via sizeof. |
| 25 | */ |
| 26 | typedef struct target_elf_gregset_t { |
| 27 | struct target_user_regs_struct pt; |
| 28 | } target_elf_gregset_t; |
| 29 | |
| 30 | /* |
| 31 | * This is used to ensure we don't load something for the wrong architecture. |
| 32 | */ |
| 33 | #define elf_check_machine(x) ((x) == EM_386 || (x) == EM_486) |
| 34 | |
| 35 | /* |
| 36 | * i386 is the only target which supplies AT_SYSINFO for the vdso. |
| 37 | * All others only supply AT_SYSINFO_EHDR. |
| 38 | */ |
| 39 | #define DLINFO_ARCH_ITEMS (vdso_info != NULL) |
| 40 | #define ARCH_DLINFO \ |
| 41 | do { \ |
| 42 | if (vdso_info) { \ |
| 43 | NEW_AUX_ENT(AT_SYSINFO, vdso_info->entry); \ |
| 44 | } \ |
| 45 | } while (0) |
| 46 | |
| 47 | #endif |