]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Another generic ELF target assertion failure
authorAlan Modra <amodra@gmail.com>
Mon, 27 May 2019 00:59:22 +0000 (10:29 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 27 May 2019 04:28:27 +0000 (13:58 +0930)
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.

bfd/ChangeLog
bfd/elf.c

index 3f7f174e9883e956ad42be339e5474a8e0aae743..18bed0699d45821fa2595837e53be5ecff4f8c0a 100644 (file)
@@ -1,3 +1,7 @@
+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
index 952e4bfe11b4a222823a31d07615007e91b519ba..b463f1df8b246922d39b298398d20c2efc98fc2e 100644 (file)
--- 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;