1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <linux/elfcore-compat.h>
18 #include <linux/time.h>
19
20
21
22
23 #undef ELF_CLASS
24 #define ELF_CLASS ELFCLASS32
25
26 #undef elfhdr
27 #undef elf_phdr
28 #undef elf_shdr
29 #undef elf_note
30 #undef elf_addr_t
31 #define elfhdr elf32_hdr
32 #define elf_phdr elf32_phdr
33 #define elf_shdr elf32_shdr
34 #define elf_note elf32_note
35 #define elf_addr_t Elf32_Addr
36
37
38
39
40 #define user_long_t compat_long_t
41 #define user_siginfo_t compat_siginfo_t
42 #define copy_siginfo_to_user copy_siginfo_to_user32
43
44
45
46
47
48 #define elf_prstatus compat_elf_prstatus
49 #define elf_prpsinfo compat_elf_prpsinfo
50
51 #undef ns_to_timeval
52 #define ns_to_timeval ns_to_old_timeval32
53
54
55
56
57
58
59
60 #undef ELF_ARCH
61 #undef elf_check_arch
62 #define elf_check_arch compat_elf_check_arch
63
64 #ifdef COMPAT_ELF_PLATFORM
65 #undef ELF_PLATFORM
66 #define ELF_PLATFORM COMPAT_ELF_PLATFORM
67 #endif
68
69 #ifdef COMPAT_ELF_HWCAP
70 #undef ELF_HWCAP
71 #define ELF_HWCAP COMPAT_ELF_HWCAP
72 #endif
73
74 #ifdef COMPAT_ELF_HWCAP2
75 #undef ELF_HWCAP2
76 #define ELF_HWCAP2 COMPAT_ELF_HWCAP2
77 #endif
78
79 #ifdef COMPAT_ARCH_DLINFO
80 #undef ARCH_DLINFO
81 #define ARCH_DLINFO COMPAT_ARCH_DLINFO
82 #endif
83
84 #ifdef COMPAT_ELF_ET_DYN_BASE
85 #undef ELF_ET_DYN_BASE
86 #define ELF_ET_DYN_BASE COMPAT_ELF_ET_DYN_BASE
87 #endif
88
89 #ifdef COMPAT_ELF_EXEC_PAGESIZE
90 #undef ELF_EXEC_PAGESIZE
91 #define ELF_EXEC_PAGESIZE COMPAT_ELF_EXEC_PAGESIZE
92 #endif
93
94 #ifdef COMPAT_ELF_PLAT_INIT
95 #undef ELF_PLAT_INIT
96 #define ELF_PLAT_INIT COMPAT_ELF_PLAT_INIT
97 #endif
98
99 #ifdef COMPAT_SET_PERSONALITY
100 #undef SET_PERSONALITY
101 #define SET_PERSONALITY COMPAT_SET_PERSONALITY
102 #endif
103
104 #ifdef compat_start_thread
105 #undef start_thread
106 #define start_thread compat_start_thread
107 #endif
108
109 #ifdef compat_arch_setup_additional_pages
110 #undef ARCH_HAS_SETUP_ADDITIONAL_PAGES
111 #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
112 #undef arch_setup_additional_pages
113 #define arch_setup_additional_pages compat_arch_setup_additional_pages
114 #endif
115
116
117
118
119
120
121 #define elf_format compat_elf_format
122 #define init_elf_binfmt init_compat_elf_binfmt
123 #define exit_elf_binfmt exit_compat_elf_binfmt
124
125
126
127
128 #include "binfmt_elf.c"