aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index bd0c6cc..c0f6eca 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
2020-07-22 Nick Alcock <nick.alcock@oracle.com>
+ * ldlang.c (ldlang_open_ctf): Set SEC_EXCLUDE on all but the
+ first input .ctf section.
+
+2020-07-22 Nick Alcock <nick.alcock@oracle.com>
+
* configure.ac (enable_libctf): Substitute it.
* Makefile.am (enablings.exp): New.
(EXTRA_DEJAGNU_SITE_CONFIG): Add it.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index bf29144..6943adf 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -3700,12 +3700,15 @@ ldlang_open_ctf (void)
}
/* Prevent the contents of this section from being written, while
- requiring the section itself to be duplicated in the output. */
+ requiring the section itself to be duplicated in the output, but only
+ once. */
/* This section must exist if ctf_bfdopen() succeeded. */
sect = bfd_get_section_by_name (file->the_bfd, ".ctf");
sect->size = 0;
sect->flags |= SEC_NEVER_LOAD | SEC_HAS_CONTENTS | SEC_LINKER_CREATED;
+ if (any_ctf)
+ sect->flags |= SEC_EXCLUDE;
any_ctf = 1;
}