From: Guo Ren Date: Sun, 30 Dec 2018 17:06:53 +0000 (+0800) Subject: csky: bugfix gdb coredump error. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2054f4af1957;p=linux.git csky: bugfix gdb coredump error. In gdb/bfd elf32-csky.c, csky_elf_grok_prstatus() use fixed size of elf_prstatus. It's 148 for abiv1 and 220 for abiv2, the size is enough for coredump and no need full sizeof(struct pt_regs). Signed-off-by: Guo Ren Reported-by: Lu Baoquan Reported-by: Liu Mao --- diff --git a/arch/csky/include/asm/elf.h b/arch/csky/include/asm/elf.h index 48b5366568abb..d6dbc00e35333 100644 --- a/arch/csky/include/asm/elf.h +++ b/arch/csky/include/asm/elf.h @@ -31,7 +31,12 @@ typedef unsigned long elf_greg_t; typedef struct user_fp elf_fpregset_t; -#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) +/* + * In gdb/bfd elf32-csky.c, csky_elf_grok_prstatus() use fixed size of + * elf_prstatus. It's 148 for abiv1 and 220 for abiv2, the size is enough + * for coredump and no need full sizeof(struct pt_regs). + */ +#define ELF_NGREG ((sizeof(struct pt_regs) / sizeof(elf_greg_t)) - 2) typedef elf_greg_t elf_gregset_t[ELF_NGREG];