From: Alan Modra Date: Mon, 27 May 2019 00:59:22 +0000 (+0930) Subject: Another generic ELF target assertion failure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce5aecf87372749a5ec511f218956756aa185d0f;p=binutils-gdb.git 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 --git a/bfd/ChangeLog b/bfd/ChangeLog index 3f7f174e988..18bed0699d4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2019-05-27 Alan Modra + + * elf.c (bfd_elf_set_group_contents): Exit on zero size section. + 2019-05-27 Alan Modra PR 24596 diff --git a/bfd/elf.c b/bfd/elf.c index 952e4bfe11b..b463f1df8b2 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;