This is the mail archive of the binutils-cvs@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]

[binutils-gdb] Inconsistent .eh_frame_hdr on powerpc64


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2d0d44d514d9a2e2b0f7ae8129d52b02160c9897

commit 2d0d44d514d9a2e2b0f7ae8129d52b02160c9897
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Nov 14 11:02:57 2017 +1030

    Inconsistent .eh_frame_hdr on powerpc64
    
    There is code in bfd/elf-eh-frame.c and ld/emultempl/elf32.em that
    checks for the presence of eh_frame info by testing for a section
    named .eh_frame sized more than 8 bytes.   The size test is to exclude
    a zero terminator.  A similar check in elf64-ppc.c wrongly just tested
    for non-zero size before creating the linker generated .eh_frame
    describing plt call and other linkage stubs.  The intention was to not
    generate that info unless there was some user .eh_frame.  (No user
    .eh_frame implies the user doesn't care about exception handling.)
    Because the test in elf64-ppc.c was wrong, ld generated the stub
    .eh_frame just on finding a zero .eh_frame terminator in crtend.o, but
    didn't generate the corresponding .eh_frame_hdr.
    
    	* elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
    	.eh_frame info.

Diff:
---
 bfd/ChangeLog   | 5 +++++
 bfd/elf64-ppc.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 70d4e56..1c9edaf 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-14  Alan Modra  <amodra@gmail.com>
+
+	* elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
+	.eh_frame info.
+
 2017-11-13  Jan Beulich  <jbeulich@suse.com>
 
 	* coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 181bbdc..31ee412 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -12700,7 +12700,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info)
 
       if (htab->glink_eh_frame != NULL
 	  && !bfd_is_abs_section (htab->glink_eh_frame->output_section)
-	  && htab->glink_eh_frame->output_section->size != 0)
+	  && htab->glink_eh_frame->output_section->size > 8)
 	{
 	  size_t size = 0, align = 4;


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