diff options
author | Alan Modra <amodra@gmail.com> | 2013-11-11 14:14:40 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2013-11-15 10:32:06 +1030 |
commit | ef1bc9e72fd2f0310ac3113acc41e1c115e3ac79 (patch) | |
tree | 305ca622a59672db9f1bf12d59eda6b5dca974da /gdb/rs6000-tdep.c | |
parent | 993a449f1714480593eb0a2a6bd6e21d8f029168 (diff) | |
download | gdb-ef1bc9e72fd2f0310ac3113acc41e1c115e3ac79.zip gdb-ef1bc9e72fd2f0310ac3113acc41e1c115e3ac79.tar.gz gdb-ef1bc9e72fd2f0310ac3113acc41e1c115e3ac79.tar.bz2 |
PowerPC64 ELFv2 trampoline match
ELFv2 needs different plt call stubs to ELFv1, register usage differs
too. When I added these to ld I changed register usage in the ELFv1
stubs as well, simplifying the linker code and (perhaps) future
maintenance. All well and good, but this means gdb needs to cope with
more stub variants. This patch also handles skipping over addis/addi
setting up r2 in ELFv2 global entry code. We want breakpoints to be
set past this point to catch calls via the local entry point.
* ppc64-tdep.c (ppc64_plt_entry_point): Renamed from..
(ppc64_desc_entry_point): ..this. Update comments here and at
call points.
(ppc64_standard_linkage1, ppc64_standard_linkage2,
ppc64_standard_linkage3): Update comments.
(ppc64_standard_linkage4, ppc64_standard_linkage5,
(ppc64_standard_linkage6, ppc64_standard_linkage7): New insn
patterns.
(ppc64_standard_linkage4_target): New function.
(ppc64_skip_trampoline_code): Skip ELFv2 patterns too.
* rs6000-tdep.c (skip_prologue): Skip ELFv2 r2 setup. Correct
nop match. Fix comment wrap.
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r-- | gdb/rs6000-tdep.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index c561bc8..477e29e 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1616,7 +1616,19 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, continue; } - else if ((op & 0xffff0000) == 0x60000000) + else if ((op & 0xffff0000) == 0x3c4c0000 + || (op & 0xffff0000) == 0x3c400000 + || (op & 0xffff0000) == 0x38420000) + { + /* . 0: addis 2,12,.TOC.-0b@ha + . addi 2,2,.TOC.-0b@l + or + . lis 2,.TOC.@ha + . addi 2,2,.TOC.@l + used by ELFv2 global entry points to set up r2. */ + continue; + } + else if (op == 0x60000000) { /* nop */ /* Allow nops in the prologue, but do not consider them to @@ -1627,8 +1639,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, } else if ((op & 0xffff0000) == 0x3c000000) - { /* addis 0,0,NUM, used - for >= 32k frames */ + { /* addis 0,0,NUM, used for >= 32k frames */ fdata->offset = (op & 0x0000ffff) << 16; fdata->frameless = 0; r0_contains_arg = 0; @@ -1636,8 +1647,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, } else if ((op & 0xffff0000) == 0x60000000) - { /* ori 0,0,NUM, 2nd ha - lf of >= 32k frames */ + { /* ori 0,0,NUM, 2nd half of >= 32k frames */ fdata->offset |= (op & 0x0000ffff); fdata->frameless = 0; r0_contains_arg = 0; |