summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-06-06 07:46:28 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-06-06 07:46:28 +0000
commit1124001c681a92bc7e42f37478cc8d7bb80008f2 (patch)
treeddc8cb9f0bde2a0df5c11a7cc0a4aa31b3f1faaf /lld/ELF/LinkerScript.cpp
parent121224d4a455e02162c122b861a1ece71387d679 (diff)
downloadbcm5719-llvm-1124001c681a92bc7e42f37478cc8d7bb80008f2.tar.gz
bcm5719-llvm-1124001c681a92bc7e42f37478cc8d7bb80008f2.zip
[ELF] - Early return from writeTo() if section is SHT_NOBITS. NFCi.
That addresses port commit comments for https://reviews.llvm.org/D33646 llvm-svn: 304777
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-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