diff options
author | Alan Modra <amodra@gmail.com> | 2018-01-24 15:22:17 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-01-26 16:13:03 +1030 |
commit | 7433498b7f1a79bf98ba272fd461f0ff9f1daa02 (patch) | |
tree | ba080007a54ea8036d9837dc338c86a0e752a11c /gdb/ppc-tdep.h | |
parent | 32253bb7963ac7caa166ec41e336372f2ffc03d4 (diff) | |
download | gdb-7433498b7f1a79bf98ba272fd461f0ff9f1daa02.zip gdb-7433498b7f1a79bf98ba272fd461f0ff9f1daa02.tar.gz gdb-7433498b7f1a79bf98ba272fd461f0ff9f1daa02.tar.bz2 |
PowerPC PLT stub matching
This patch fixes a number of bugs in ppc32 plt stub matching code.
1) The 4-insn stubs for shared libs and PIEs weren't matched.
2) The executable stub miscalculated PLT entry address (by oring a
sign-extended quantity rather than adding).
3) Comments were not accurate.
In addition, the insn arrays are made const.
* ppc-linux-tdep.c (powerpc32_plt_stub): Make const.
(powerpc32_plt_stub_so_1): Rename from powerpc32_plt_stub_so.
Remove nop. Make const. Comment.
(powerpc32_plt_stub_so_2): New.
(POWERPC32_PLT_CHECK_LEN): Rename from POWERPC32_PLT_STUB_LEN.
Correct count. Update uses.
(ppc_skip_trampoline_code): Match powerpc32_plt_stub_so_2 too.
Move common code reading PLT entry word. Correct
powerpc32_plt_stub PLT address calculation.
* ppc64-tdep.c (ppc64_standard_linkage1): Make const.
(ppc64_standard_linkage2, ppc64_standard_linkage3): Likewise.
(ppc64_standard_linkage4, ppc64_standard_linkage5): Likewise.
(ppc64_standard_linkage6, ppc64_standard_linkage7): Likewise.
(ppc64_standard_linkage8): Likewise.
* rs6000-tdep.c (ppc_insns_match_pattern): Make pattern const.
Correct insns description.
* ppc-tdep.h (ppc_insns_match_pattern): Update prototype.
Reviewed-By: Yao Qi <qiyaoltc@gmail.com>
Diffstat (limited to 'gdb/ppc-tdep.h')
-rw-r--r-- | gdb/ppc-tdep.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h index 3004744..156f82d 100644 --- a/gdb/ppc-tdep.h +++ b/gdb/ppc-tdep.h @@ -330,7 +330,7 @@ struct ppc_insn_pattern }; extern int ppc_insns_match_pattern (struct frame_info *frame, CORE_ADDR pc, - struct ppc_insn_pattern *pattern, + const struct ppc_insn_pattern *pattern, unsigned int *insns); extern CORE_ADDR ppc_insn_d_field (unsigned int insn); |