Skip to content

Commit 9eb3e57

Browse files
committed
Simplify and fix style.
llvm-svn: 251927
1 parent 07b825b commit 9eb3e57

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lld/ELF/Writer.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -700,19 +700,17 @@ template <class ELFT> void Writer<ELFT>::assignAddresses() {
700700
}
701701
}
702702

703-
if (Sec->getSize() && (Sec->getFlags() & SHF_ALLOC) &&
704-
(Sec->getFlags() & SHF_TLS)) {
705-
if (!TlsPhdr.p_vaddr) {
703+
if (Sec->getSize() && (Sec->getFlags() & (SHF_ALLOC | SHF_TLS))) {
704+
if (!TlsPhdr.p_vaddr)
706705
setPhdr(&TlsPhdr, PT_TLS, PF_R, FileOff, VA, 0, Sec->getAlign());
707-
}
708706
if (Sec->getType() != SHT_NOBITS)
709707
VA = RoundUpToAlignment(VA, Sec->getAlign());
710708
uintX_t TVA = RoundUpToAlignment(VA + ThreadBSSOffset, Sec->getAlign());
711709
Sec->setVA(TVA);
712710
TlsPhdr.p_memsz += Sec->getSize();
713-
if (Sec->getType() == SHT_NOBITS)
711+
if (Sec->getType() == SHT_NOBITS) {
714712
ThreadBSSOffset = TVA - VA + Sec->getSize();
715-
else {
713+
} else {
716714
TlsPhdr.p_filesz += Sec->getSize();
717715
VA += Sec->getSize();
718716
}

0 commit comments

Comments
 (0)