diff options
author | Will Deacon <will.deacon@arm.com> | 2013-01-22 10:34:40 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2013-01-22 12:50:59 -0500 |
commit | 9cf2b72b25f3f6a5a1a46a4f36037e66de52465c (patch) | |
tree | d4e62f892cb3097767bd5e58744b920884443b7a | |
parent | 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619 (diff) |
arm64: elf: fix core dumping to match what glibc expects
The kernel's internal definition of ELF_NGREG uses struct pt_regs, which
means that we disagree with userspace on the size of coredumps since
glibc correctly uses the user-visible struct user_pt_regs.
This patch fixes our ELF_NGREG definition to use struct user_pt_regs
and introduces our own ELF_CORE_COPY_REGS to convert between the user
and kernel structure definitions.
Cc: <stable@vger.kernel.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | arch/arm64/include/asm/elf.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index 07fea290d7c1..fe32c0e4ac01 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h | |||
@@ -26,7 +26,10 @@ | |||
26 | 26 | ||
27 | typedef unsigned long elf_greg_t; | 27 | typedef unsigned long elf_greg_t; |
28 | 28 | ||
29 | #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) | 29 | #define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(elf_greg_t)) |
30 | #define ELF_CORE_COPY_REGS(dest, regs) \ | ||
31 | *(struct user_pt_regs *)&(dest) = (regs)->user_regs; | ||
32 | |||
30 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | 33 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
31 | typedef struct user_fpsimd_state elf_fpregset_t; | 34 | typedef struct user_fpsimd_state elf_fpregset_t; |
32 | 35 | ||