Synchronize the linker script with -r.
I don't have a testcase in mind, but there is no reason to have the
linker script out of sync during a -r link.
llvm-svn: 304433
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 9bc28a6..4cd7a82 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -273,10 +273,11 @@
parallelForEach(OutputSections.begin(), OutputSections.end(),
[](OutputSection *S) { S->maybeCompress<ELFT>(); });
+ Script->synchronize();
+
if (Config->Relocatable) {
assignFileOffsets();
} else {
- Script->synchronize();
Script->assignAddresses(Phdrs, OutputSectionCommands);
// Remove empty PT_LOAD to avoid causing the dynamic linker to try to mmap a