Commit f9ce1060 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: include vsyscall page in core dumps

From: Bodo Stroesser

Complete the dump with the vsyscall-information, if a vsyscall-page
is available.
Signed-off-by: default avatarBodo Stroesser <bodo.stroesser@fujitsu-siemens.com>
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a0dafc99
......@@ -88,22 +88,18 @@ do { \
* Dumping its extra ELF program headers includes all the other information
* a debugger needs to easily find how the vsyscall DSO was being used.
*/
#if 0
#define ELF_CORE_EXTRA_PHDRS (VSYSCALL_EHDR->e_phnum)
#endif
#undef ELF_CORE_EXTRA_PHDRS
#define ELF_CORE_EXTRA_PHDRS \
(vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 )
#if 0
#define ELF_CORE_WRITE_EXTRA_PHDRS \
do { \
const struct elf_phdr *const vsyscall_phdrs = \
(const struct elf_phdr *) (VSYSCALL_BASE \
+ VSYSCALL_EHDR->e_phoff); \
if ( vsyscall_ehdr ) { \
const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
const struct elf_phdr *const phdrp = \
(const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
int i; \
Elf32_Off ofs = 0; \
for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \
struct elf_phdr phdr = vsyscall_phdrs[i]; \
for (i = 0; i < ehdrp->e_phnum; ++i) { \
struct elf_phdr phdr = phdrp[i]; \
if (phdr.p_type == PT_LOAD) { \
ofs = phdr.p_offset = offset; \
offset += phdr.p_filesz; \
......@@ -113,23 +109,19 @@ do { \
phdr.p_paddr = 0; /* match other core phdrs */ \
DUMP_WRITE(&phdr, sizeof(phdr)); \
} \
} while (0)
}
#define ELF_CORE_WRITE_EXTRA_DATA \
do { \
const struct elf_phdr *const vsyscall_phdrs = \
(const struct elf_phdr *) (VSYSCALL_BASE \
+ VSYSCALL_EHDR->e_phoff); \
if ( vsyscall_ehdr ) { \
const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
const struct elf_phdr *const phdrp = \
(const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
int i; \
for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \
if (vsyscall_phdrs[i].p_type == PT_LOAD) \
DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \
vsyscall_phdrs[i].p_filesz); \
for (i = 0; i < ehdrp->e_phnum; ++i) { \
if (phdrp[i].p_type == PT_LOAD) \
DUMP_WRITE((void *) phdrp[i].p_vaddr, \
phdrp[i].p_filesz); \
} \
} while (0)
#endif
#undef ELF_CORE_WRITE_EXTRA_PHDRS
#undef ELF_CORE_WRITE_EXTRA_DATA
}
#define R_386_NONE 0
#define R_386_32 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment