From: Alan Modra Date: Wed, 29 Jul 2020 08:00:15 +0000 (+0930) Subject: Don't assert at ldwrite.c:212 X-Git-Tag: binutils-2_35_2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9107f37953b565a7604a4d89b8f2bf5b07a0279b;p=thirdparty%2Fbinutils-gdb.git Don't assert at ldwrite.c:212 When excluding SHF_LINK_ORDER sections that happen to have SEC_KEEP set, we need to set SEC_EXCLUDE here to avoid a problem later. * ldelf.c (ldelf_before_place_orphans): Set SEC_EXCLUDE for discarded sections. (cherry picked from commit 5987401fcbc9933808fa0d84d1b01c93356c39a1) --- diff --git a/ld/ChangeLog b/ld/ChangeLog index d8abc62717c..e9374b46335 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2021-01-30 Alan Modra + + Apply from master + 2020-07-29 Alan Modra + * ldelf.c (ldelf_before_place_orphans): Set SEC_EXCLUDE for + discarded sections. + 2021-01-01 Alan Modra Apply from master diff --git a/ld/ldelf.c b/ld/ldelf.c index 831d032fe56..bcac331ff56 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c @@ -2192,6 +2192,7 @@ ldelf_before_place_orphans (void) if (discarded_section (linked_to_sec)) { isec->output_section = bfd_abs_section_ptr; + isec->flags |= SEC_EXCLUDE; break; } }