From: Jeff Dike From: Bodo Stroesser Complete the dump with the vsyscall-information, if a vsyscall-page is available. Signed-off-by: Bodo Stroesser Signed-off-by: Jeff Dike Signed-off-by: Andrew Morton --- 25-akpm/include/asm-um/archparam-i386.h | 44 +++++++++++++------------------- 1 files changed, 18 insertions(+), 26 deletions(-) diff -puN include/asm-um/archparam-i386.h~uml-include-vsyscall-page-in-core-dumps include/asm-um/archparam-i386.h --- 25/include/asm-um/archparam-i386.h~uml-include-vsyscall-page-in-core-dumps Fri Dec 3 13:50:29 2004 +++ 25-akpm/include/asm-um/archparam-i386.h Fri Dec 3 13:50:29 2004 @@ -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 +#define ELF_CORE_EXTRA_PHDRS \ + (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 ) -#undef ELF_CORE_EXTRA_PHDRS - -#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 _