This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Correct eh_frame info for __glink_PLTresolve
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 23 Jul 2017 11:17:51 -0000
- Subject: [binutils-gdb] Correct eh_frame info for __glink_PLTresolve
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=15a3a14fdd725c049d6b2aadbaf66c9be5ed36a8
commit 15a3a14fdd725c049d6b2aadbaf66c9be5ed36a8
Author: Alan Modra <amodra@gmail.com>
Date: Sun Jul 23 20:03:40 2017 +0930
Correct eh_frame info for __glink_PLTresolve
My PPC64_OPT_LOCALENTRY patch of June 1, git commit f378ab099d, and
the later gold change, git commit 7ee7ff7015, added an insn in
__glink_PLTresolve which needs a corresponding adjustment in the
eh_frame info for asynchronous exceptions to unwind correctly.
It would have been OK for both ABIs to use +5 for the advance before
restore of LR, since we can put the DW_CFA_restore_extended on any
insn after the actual restore and before the r12/r0 copy is clobbered,
but it's slightly better to delay as much as possible. There are
then more addresses where fewer CFA program insns are executed.
bfd/
* elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
restore of LR.
gold/
* powerpc.cc (glink_eh_frame_fde_64v2): Correct advance to
restore of LR.
(glink_eh_frame_fde_64v1): Advance to restore of LR at latest
possible insn.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elf64-ppc.c | 2 +-
gold/ChangeLog | 7 +++++++
gold/powerpc.cc | 4 ++--
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9f478f2..66d8124 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-23 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
+ restore of LR.
+
2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR ld/18841
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 9903373..f399e35 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -12871,7 +12871,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info)
*p++ = DW_CFA_register;
*p++ = 65;
*p++ = htab->opd_abi ? 12 : 0;
- *p++ = DW_CFA_advance_loc + 4;
+ *p++ = DW_CFA_advance_loc + (htab->opd_abi ? 5 : 7);
*p++ = DW_CFA_restore_extended;
*p++ = 65;
p += ((24 + align - 1) & -align) - 24;
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 0dc3972..01f0d34 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,10 @@
+2017-07-23 Alan Modra <amodra@gmail.com>
+
+ * powerpc.cc (glink_eh_frame_fde_64v2): Correct advance to
+ restore of LR.
+ (glink_eh_frame_fde_64v1): Advance to restore of LR at latest
+ possible insn.
+
2017-07-18 Nick Clifton <nickc@redhat.com>
PR 21775
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index fcbf177..a4966b8 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -3987,7 +3987,7 @@ static const unsigned char glink_eh_frame_fde_64v1[] =
0, // Augmentation size.
elfcpp::DW_CFA_advance_loc + 1,
elfcpp::DW_CFA_register, 65, 12,
- elfcpp::DW_CFA_advance_loc + 4,
+ elfcpp::DW_CFA_advance_loc + 5,
elfcpp::DW_CFA_restore_extended, 65
};
@@ -3999,7 +3999,7 @@ static const unsigned char glink_eh_frame_fde_64v2[] =
0, // Augmentation size.
elfcpp::DW_CFA_advance_loc + 1,
elfcpp::DW_CFA_register, 65, 0,
- elfcpp::DW_CFA_advance_loc + 4,
+ elfcpp::DW_CFA_advance_loc + 7,
elfcpp::DW_CFA_restore_extended, 65
};