1 |
From d86cf1b0d5ac6c0d900ae2b2a07fce7c4414d0e6 Mon Sep 17 00:00:00 2001 |
2 |
From: Alan Modra <amodra@gmail.com> |
3 |
Date: Sat, 7 Aug 2021 14:10:38 +0930 |
4 |
Subject: [PATCH] PR28186, SEGV elf.c:7991:30 in _bfd_elf_fixup_group_sections |
5 |
|
6 |
PR 28186 |
7 |
* elf.c (_bfd_elf_fixup_group_sections): Don't segfault on |
8 |
objcopy/strip with NULL output_section. |
9 |
|
10 |
(cherry picked from commit 182ad37589e3931390d0c43f1d52a9a6e0062a61) |
11 |
--- |
12 |
bfd/elf.c | 2 +- |
13 |
1 file changed, 1 insertion(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/bfd/elf.c b/bfd/elf.c |
16 |
index de5abafabf0..9c3f34c415b 100644 |
17 |
--- a/bfd/elf.c |
18 |
+++ b/bfd/elf.c |
19 |
@@ -7984,7 +7984,7 @@ _bfd_elf_fixup_group_sections (bfd *ibfd, asection *discarded) |
20 |
isec->flags |= SEC_EXCLUDE; |
21 |
} |
22 |
} |
23 |
- else |
24 |
+ else if (isec->output_section != NULL) |
25 |
{ |
26 |
/* Adjust the output section size when called from |
27 |
objcopy. */ |
28 |
-- |
29 |
2.32.0 |
30 |
|