diff options
author | Roland McGrath <roland@redhat.com> | 2007-01-26 03:56:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-26 16:50:58 -0500 |
commit | f47aef55d9a18945fcdd7fd6bf01121ce973b91b (patch) | |
tree | 69f5f6c1fd4ae27d18344ae4b33b5c7bd4b18699 /include/asm-i386/elf.h | |
parent | e5b97dde514f9bd43f9e525451d0a863c4fc8a9a (diff) |
[PATCH] i386 vDSO: use VM_ALWAYSDUMP
This patch fixes core dumps to include the vDSO vma, which is left out now.
It removes the special-case core writing macros, which were not doing the
right thing for the vDSO vma anyway. Instead, it uses VM_ALWAYSDUMP in the
vma; there is no need for the fixmap page to be installed. It handles the
CONFIG_COMPAT_VDSO case by making elf_core_dump use the fake vma from
get_gate_vma after real vmas in the same way the /proc/PID/maps code does.
This changes core dumps so they no longer include the non-PT_LOAD phdrs from
the vDSO. I made the change to add them in the first place, but in turned out
that nothing ever wanted them there since the advent of NT_AUXV. It's cleaner
to leave them out, and just let the phdrs inside the vDSO image speak for
themselves.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-i386/elf.h')
-rw-r--r-- | include/asm-i386/elf.h | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index 0515d61d5411..369035dfe4b6 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h | |||
@@ -168,50 +168,6 @@ do if (vdso_enabled) { \ | |||
168 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_COMPAT_BASE); \ | 168 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_COMPAT_BASE); \ |
169 | } while (0) | 169 | } while (0) |
170 | 170 | ||
171 | /* | ||
172 | * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out | ||
173 | * extra segments containing the vsyscall DSO contents. Dumping its | ||
174 | * contents makes post-mortem fully interpretable later without matching up | ||
175 | * the same kernel and hardware config to see what PC values meant. | ||
176 | * Dumping its extra ELF program headers includes all the other information | ||
177 | * a debugger needs to easily find how the vsyscall DSO was being used. | ||
178 | */ | ||
179 | #define ELF_CORE_EXTRA_PHDRS (VDSO_HIGH_EHDR->e_phnum) | ||
180 | #define ELF_CORE_WRITE_EXTRA_PHDRS \ | ||
181 | do { \ | ||
182 | const struct elf_phdr *const vsyscall_phdrs = \ | ||
183 | (const struct elf_phdr *) (VDSO_HIGH_BASE \ | ||
184 | + VDSO_HIGH_EHDR->e_phoff); \ | ||
185 | int i; \ | ||
186 | Elf32_Off ofs = 0; \ | ||
187 | for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \ | ||
188 | struct elf_phdr phdr = vsyscall_phdrs[i]; \ | ||
189 | if (phdr.p_type == PT_LOAD) { \ | ||
190 | BUG_ON(ofs != 0); \ | ||
191 | ofs = phdr.p_offset = offset; \ | ||
192 | phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \ | ||
193 | phdr.p_filesz = phdr.p_memsz; \ | ||
194 | offset += phdr.p_filesz; \ | ||
195 | } \ | ||
196 | else \ | ||
197 | phdr.p_offset += ofs; \ | ||
198 | phdr.p_paddr = 0; /* match other core phdrs */ \ | ||
199 | DUMP_WRITE(&phdr, sizeof(phdr)); \ | ||
200 | } \ | ||
201 | } while (0) | ||
202 | #define ELF_CORE_WRITE_EXTRA_DATA \ | ||
203 | do { \ | ||
204 | const struct elf_phdr *const vsyscall_phdrs = \ | ||
205 | (const struct elf_phdr *) (VDSO_HIGH_BASE \ | ||
206 | + VDSO_HIGH_EHDR->e_phoff); \ | ||
207 | int i; \ | ||
208 | for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \ | ||
209 | if (vsyscall_phdrs[i].p_type == PT_LOAD) \ | ||
210 | DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ | ||
211 | PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \ | ||
212 | } \ | ||
213 | } while (0) | ||
214 | |||
215 | #endif | 171 | #endif |
216 | 172 | ||
217 | #endif | 173 | #endif |