aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-07-29 17:30:15 +0930
committerAlan Modra <amodra@gmail.com>2021-01-30 09:14:00 +1030
commit9107f37953b565a7604a4d89b8f2bf5b07a0279b (patch)
tree8e5fca332d32724f45074cc366d8c50c1a1a285c
parentgold: Skip address size and segment selector for DWARF5 (diff)
downloadbinutils-gdb-9107f37953b565a7604a4d89b8f2bf5b07a0279b.tar.gz
binutils-gdb-9107f37953b565a7604a4d89b8f2bf5b07a0279b.tar.bz2
binutils-gdb-9107f37953b565a7604a4d89b8f2bf5b07a0279b.zip
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)
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/ldelf.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index d8abc62717..e9374b4633 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2021-01-30 Alan Modra <amodra@gmail.com>
+
+ Apply from master
+ 2020-07-29 Alan Modra <amodra@gmail.com>
+ * ldelf.c (ldelf_before_place_orphans): Set SEC_EXCLUDE for
+ discarded sections.
+
2021-01-01 Alan Modra <amodra@gmail.com>
Apply from master
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 831d032fe5..bcac331ff5 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;
}
}