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 { \ ...@@ -88,22 +88,18 @@ do { \
* Dumping its extra ELF program headers includes all the other information * Dumping its extra ELF program headers includes all the other information
* a debugger needs to easily find how the vsyscall DSO was being used. * a debugger needs to easily find how the vsyscall DSO was being used.
*/ */
#if 0 #define ELF_CORE_EXTRA_PHDRS \
#define ELF_CORE_EXTRA_PHDRS (VSYSCALL_EHDR->e_phnum) (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 )
#endif
#undef ELF_CORE_EXTRA_PHDRS
#if 0
#define ELF_CORE_WRITE_EXTRA_PHDRS \ #define ELF_CORE_WRITE_EXTRA_PHDRS \
do { \ if ( vsyscall_ehdr ) { \
const struct elf_phdr *const vsyscall_phdrs = \ const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
(const struct elf_phdr *) (VSYSCALL_BASE \ const struct elf_phdr *const phdrp = \
+ VSYSCALL_EHDR->e_phoff); \ (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
int i; \ int i; \
Elf32_Off ofs = 0; \ Elf32_Off ofs = 0; \
for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ for (i = 0; i < ehdrp->e_phnum; ++i) { \
struct elf_phdr phdr = vsyscall_phdrs[i]; \ struct elf_phdr phdr = phdrp[i]; \
if (phdr.p_type == PT_LOAD) { \ if (phdr.p_type == PT_LOAD) { \
ofs = phdr.p_offset = offset; \ ofs = phdr.p_offset = offset; \
offset += phdr.p_filesz; \ offset += phdr.p_filesz; \
...@@ -113,23 +109,19 @@ do { \ ...@@ -113,23 +109,19 @@ do { \
phdr.p_paddr = 0; /* match other core phdrs */ \ phdr.p_paddr = 0; /* match other core phdrs */ \
DUMP_WRITE(&phdr, sizeof(phdr)); \ DUMP_WRITE(&phdr, sizeof(phdr)); \
} \ } \
} while (0) }
#define ELF_CORE_WRITE_EXTRA_DATA \ #define ELF_CORE_WRITE_EXTRA_DATA \
do { \ if ( vsyscall_ehdr ) { \
const struct elf_phdr *const vsyscall_phdrs = \ const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
(const struct elf_phdr *) (VSYSCALL_BASE \ const struct elf_phdr *const phdrp = \
+ VSYSCALL_EHDR->e_phoff); \ (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
int i; \ int i; \
for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ for (i = 0; i < ehdrp->e_phnum; ++i) { \
if (vsyscall_phdrs[i].p_type == PT_LOAD) \ if (phdrp[i].p_type == PT_LOAD) \
DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ DUMP_WRITE((void *) phdrp[i].p_vaddr, \
vsyscall_phdrs[i].p_filesz); \ 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_NONE 0
#define R_386_32 1 #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