diff options
Diffstat (limited to 'include/asm-i386/elf.h')
-rw-r--r-- | include/asm-i386/elf.h | 51 |
1 files changed, 3 insertions, 48 deletions
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index 45d21a0c95bf..369035dfe4b6 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h | |||
@@ -143,11 +143,8 @@ extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct | |||
143 | # define VDSO_PRELINK 0 | 143 | # define VDSO_PRELINK 0 |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | #define VDSO_COMPAT_SYM(x) \ | ||
147 | (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK) | ||
148 | |||
149 | #define VDSO_SYM(x) \ | 146 | #define VDSO_SYM(x) \ |
150 | (VDSO_BASE + (unsigned long)(x) - VDSO_PRELINK) | 147 | (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK) |
151 | 148 | ||
152 | #define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE) | 149 | #define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE) |
153 | #define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE) | 150 | #define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE) |
@@ -156,10 +153,12 @@ extern void __kernel_vsyscall; | |||
156 | 153 | ||
157 | #define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall) | 154 | #define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall) |
158 | 155 | ||
156 | #ifndef CONFIG_COMPAT_VDSO | ||
159 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES | 157 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES |
160 | struct linux_binprm; | 158 | struct linux_binprm; |
161 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, | 159 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, |
162 | int executable_stack); | 160 | int executable_stack); |
161 | #endif | ||
163 | 162 | ||
164 | extern unsigned int vdso_enabled; | 163 | extern unsigned int vdso_enabled; |
165 | 164 | ||
@@ -169,50 +168,6 @@ do if (vdso_enabled) { \ | |||
169 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_COMPAT_BASE); \ | 168 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_COMPAT_BASE); \ |
170 | } while (0) | 169 | } while (0) |
171 | 170 | ||
172 | /* | ||
173 | * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out | ||
174 | * extra segments containing the vsyscall DSO contents. Dumping its | ||
175 | * contents makes post-mortem fully interpretable later without matching up | ||
176 | * the same kernel and hardware config to see what PC values meant. | ||
177 | * Dumping its extra ELF program headers includes all the other information | ||
178 | * a debugger needs to easily find how the vsyscall DSO was being used. | ||
179 | */ | ||
180 | #define ELF_CORE_EXTRA_PHDRS (VDSO_HIGH_EHDR->e_phnum) | ||
181 | #define ELF_CORE_WRITE_EXTRA_PHDRS \ | ||
182 | do { \ | ||
183 | const struct elf_phdr *const vsyscall_phdrs = \ | ||
184 | (const struct elf_phdr *) (VDSO_HIGH_BASE \ | ||
185 | + VDSO_HIGH_EHDR->e_phoff); \ | ||
186 | int i; \ | ||
187 | Elf32_Off ofs = 0; \ | ||
188 | for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \ | ||
189 | struct elf_phdr phdr = vsyscall_phdrs[i]; \ | ||
190 | if (phdr.p_type == PT_LOAD) { \ | ||
191 | BUG_ON(ofs != 0); \ | ||
192 | ofs = phdr.p_offset = offset; \ | ||
193 | phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \ | ||
194 | phdr.p_filesz = phdr.p_memsz; \ | ||
195 | offset += phdr.p_filesz; \ | ||
196 | } \ | ||
197 | else \ | ||
198 | phdr.p_offset += ofs; \ | ||
199 | phdr.p_paddr = 0; /* match other core phdrs */ \ | ||
200 | DUMP_WRITE(&phdr, sizeof(phdr)); \ | ||
201 | } \ | ||
202 | } while (0) | ||
203 | #define ELF_CORE_WRITE_EXTRA_DATA \ | ||
204 | do { \ | ||
205 | const struct elf_phdr *const vsyscall_phdrs = \ | ||
206 | (const struct elf_phdr *) (VDSO_HIGH_BASE \ | ||
207 | + VDSO_HIGH_EHDR->e_phoff); \ | ||
208 | int i; \ | ||
209 | for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \ | ||
210 | if (vsyscall_phdrs[i].p_type == PT_LOAD) \ | ||
211 | DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ | ||
212 | PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \ | ||
213 | } \ | ||
214 | } while (0) | ||
215 | |||
216 | #endif | 171 | #endif |
217 | 172 | ||
218 | #endif | 173 | #endif |