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] Another generic ELF target assertion failure


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

commit ce5aecf87372749a5ec511f218956756aa185d0f
Author: Alan Modra <amodra@gmail.com>
Date:   Mon May 27 10:29:22 2019 +0930

    Another generic ELF target assertion failure
    
    After fixing the ld-elf/pr22836-1a segmentation fault we run into an
    assertion failure due to the generic ELF target not removing empty
    SHT_GROUP sections.  Avoid that.
    
    	* elf.c (bfd_elf_set_group_contents): Exit on zero size section.

Diff:
---
 bfd/ChangeLog | 4 ++++
 bfd/elf.c     | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3f7f174..18bed06 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,9 @@
 2019-05-27  Alan Modra  <amodra@gmail.com>
 
+	* elf.c (bfd_elf_set_group_contents): Exit on zero size section.
+
+2019-05-27  Alan Modra  <amodra@gmail.com>
+
 	PR 24596
 	* linker.c (_bfd_generic_link_output_symbols): Heed BSF_KEEP.
 
diff --git a/bfd/elf.c b/bfd/elf.c
index 952e4bf..b463f1d 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3472,7 +3472,8 @@ bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
 
   /* Ignore linker created group section.  See elfNN_ia64_object_p in
      elfxx-ia64.c.  */
-  if (((sec->flags & (SEC_GROUP | SEC_LINKER_CREATED)) != SEC_GROUP)
+  if ((sec->flags & (SEC_GROUP | SEC_LINKER_CREATED)) != SEC_GROUP
+      || sec->size == 0
       || *failedptr)
     return;


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