This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Correct powerpc64le __glink_PLTresolve .eh_frame FDE


Adding Scot Nielsen into this discussion too.

Thanks,

-Ed

-----Original Message-----
From: Alan Modra [mailto:amodra@gmail.com] 
Sent: Saturday, October 17, 2015 5:53 AM
To: Kevin Fletcher <Kevin.Fletcher@microfocus.com>; binutils@sourceware.org
Cc: sjmunroe@us.ibm.com; Ed Airey <Ed.Airey@microfocus.com>
Subject: Correct powerpc64le __glink_PLTresolve .eh_frame FDE

On Fri, Oct 16, 2015 at 12:26:11PM +0000, Kevin Fletcher wrote:
>   DW_CFA_register: r65 in r12

This is a linker bug since the FDE for __glink_PLTresolve is linker generated.  eh_frame is OK for ELFv1 but wrong for ELFv2 where lr is saved in r0.

	* elf64-ppc.c (ppc64_elf_size_stubs): Correct __glink_PLTresolve
	eh_frame FDE for ELFv1.

diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index e5344df..cda8e59 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -12583,7 +12583,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info)
 	  *p++ = DW_CFA_advance_loc + 1;
 	  *p++ = DW_CFA_register;
 	  *p++ = 65;
-	  *p++ = 12;
+	  *p++ = htab->opd_abi ? 12 : 0;
 	  *p++ = DW_CFA_advance_loc + 4;
 	  *p++ = DW_CFA_restore_extended;
 	  *p++ = 65;

--
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]