• Alex Smith's avatar
    MIPS: ptrace: Change GP regset to use correct core dump register layout · c23b3d1a
    Alex Smith authored
    Commit 6a9c001b ("MIPS: Switch ELF core dumper to use regsets.")
    switched the core dumper to use regsets, however the GP regset code
    simply makes a direct copy of the kernel's pt_regs, which does not
    match the original core dump register layout as defined in asm/reg.h.
    Furthermore, the definition of pt_regs can vary with certain Kconfig
    variables, therefore the GP regset can never be relied upon to return
    registers in the same layout.
    
    Therefore, this patch changes the GP regset to match the original core
    dump layout. The layout differs for 32- and 64-bit processes, so
    separate implementations of the get/set functions are added for the
    32- and 64-bit regsets.
    Signed-off-by: default avatarAlex Smith <alex@alex-smith.me.uk>
    Cc: <stable@vger.kernel.org> # v3.13+
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/7452/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    c23b3d1a
ptrace.c 18.6 KB