aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index a89fcf6..6aea882 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -4130,6 +4130,12 @@ lang_process ()
if (command_line.gc_sections)
lang_gc_sections ();
+ /* If there were any SEC_MERGE sections, finish their merging, so that
+ section sizes can be computed. This has to be done after GC of sections,
+ so that GCed sections are not merged, but before assigning output
+ sections, since removing whole input sections is hard then. */
+ bfd_merge_sections (output_bfd, &link_info);
+
/* Size up the common data. */
lang_common ();