From: Alan Modra Date: Wed, 29 Jul 2020 08:00:15 +0000 (+0930) Subject: Don't assert at ldwrite.c:212 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5987401fcbc9933808fa0d84d1b01c93356c39a1;p=binutils-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. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 9cee3ca275b..5ee1a0ea55d 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2020-07-29 Alan Modra + + * ldelf.c (ldelf_before_place_orphans): Set SEC_EXCLUDE for + discarded sections. + 2020-07-28 Alan Modra * ldlang.c (lang_check): Don't complain about relocs or merge diff --git a/ld/ldelf.c b/ld/ldelf.c index 729239c101e..75c6c015aee 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c @@ -2190,6 +2190,7 @@ ldelf_before_place_orphans (void) if (discarded_section (linked_to_sec)) { isec->output_section = bfd_abs_section_ptr; + isec->flags |= SEC_EXCLUDE; break; } }