summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Writer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index d3da0e11404..7a8a4342446 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -700,7 +700,8 @@ template <class ELFT> void Writer<ELFT>::assignAddresses() {
}
}
- if (Sec->getSize() && (Sec->getFlags() & (SHF_ALLOC | SHF_TLS))) {
+ if (Sec->getSize() && (Sec->getFlags() & SHF_ALLOC) &&
+ (Sec->getFlags() & SHF_TLS)) {
if (!TlsPhdr.p_vaddr)
setPhdr(&TlsPhdr, PT_TLS, PF_R, FileOff, VA, 0, Sec->getAlign());
if (Sec->getType() != SHT_NOBITS)
OpenPOWER on IntegriCloud