aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-05-27 10:29:22 +0930
committerAlan Modra <amodra@gmail.com>2019-05-27 13:58:27 +0930
commitce5aecf87372749a5ec511f218956756aa185d0f (patch)
tree9d87598334ae175dbe2319925d2956935fdddf21 /bfd/elf.c
parent3d7d6a6ff4678685f86976f08ab4c9c639e262e1 (diff)
downloadgdb-ce5aecf87372749a5ec511f218956756aa185d0f.zip
gdb-ce5aecf87372749a5ec511f218956756aa185d0f.tar.gz
gdb-ce5aecf87372749a5ec511f218956756aa185d0f.tar.bz2
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.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c3
1 files changed, 2 insertions, 1 deletions
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;