Move synchronize earlier.
This is probably the correct location for it: next to
fabricateDefaultCommands. If we don't have a linker script, we
fabricate one. If we have one, we patch it.
llvm-svn: 304436
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 0ece206..80a4d68 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -261,6 +261,8 @@
if (!Config->Relocatable)
fixSectionAlignments();
Script->fabricateDefaultCommands();
+ } else {
+ Script->synchronize();
}
for (BaseCommand *Base : Script->Opt.Commands)
@@ -273,7 +275,6 @@
parallelForEach(OutputSections.begin(), OutputSections.end(),
[](OutputSection *S) { S->maybeCompress<ELFT>(); });
- Script->synchronize();
clearOutputSections();
if (Config->Relocatable) {