summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/LinkerScript.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 1ced3e8e8d7..5a10e8c634f 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -1099,6 +1099,9 @@ template <class ELFT> void OutputSectionCommand::maybeCompress() {
}
template <class ELFT> void OutputSectionCommand::writeTo(uint8_t *Buf) {
+ if (Sec->Type == SHT_NOBITS)
+ return;
+
Sec->Loc = Buf;
// We may have already rendered compressed content when using
@@ -1110,9 +1113,6 @@ template <class ELFT> void OutputSectionCommand::writeTo(uint8_t *Buf) {
return;
}
- if (Sec->Type == SHT_NOBITS)
- return;
-
// Write leading padding.
std::vector<InputSection *> Sections;
for (BaseCommand *Cmd : Commands)
OpenPOWER on IntegriCloud