]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR28186, SEGV elf.c:7991:30 in _bfd_elf_fixup_group_sections
authorAlan Modra <amodra@gmail.com>
Sat, 7 Aug 2021 04:40:38 +0000 (14:10 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 7 Aug 2021 09:14:40 +0000 (18:44 +0930)
PR 28186
* elf.c (_bfd_elf_fixup_group_sections): Don't segfault on
objcopy/strip with NULL output_section.

(cherry picked from commit 182ad37589e3931390d0c43f1d52a9a6e0062a61)

bfd/elf.c

index de5abafabf0b888c31a6f1eeeda529c921de467e..9c3f34c415b5f19ca764f76f5950191b50cdae7c 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -7984,7 +7984,7 @@ _bfd_elf_fixup_group_sections (bfd *ibfd, asection *discarded)
                    isec->flags |= SEC_EXCLUDE;
                  }
              }
-           else
+           else if (isec->output_section != NULL)
              {
                /* Adjust the output section size when called from
                   objcopy. */