]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Correct eh_frame info for __glink_PLTresolve
authorAlan Modra <amodra@gmail.com>
Sun, 23 Jul 2017 10:33:40 +0000 (20:03 +0930)
committerAlan Modra <amodra@gmail.com>
Sun, 23 Jul 2017 11:18:59 +0000 (20:48 +0930)
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.

bfd/ChangeLog
bfd/elf64-ppc.c
gold/ChangeLog
gold/powerpc.cc

index 9788ec37c19139c4bcbda2ebab5af89688e57d7c..6fb0946cae71b75f897f42174d172b0a89bd55fc 100644 (file)
@@ -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-18  Nick Clifton  <nickc@redhat.com>
 
        * po/es.po: Updated translation.
index 70ad6c5a69b1dc22ffffc38a0c315e21066b1dc7..6389cd24fcf492030cc49c7a5a61d9a95be4b8d8 100644 (file)
@@ -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;
index 0f2fe91fc76468afd4782a31e7570346789ccbed..b1b30cbd932057ef99cde0f2b916a8064cdd43f4 100644 (file)
@@ -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>
 
        * po/es.po: Updated translation.
index a046bbee33f7ed127bd064a00852fd0ced22b191..1135acdcab7047ec968774c82fca391f779725c8 100644 (file)
@@ -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
 };