Skip to content

Commit

Permalink
[ELF] Don't align PT_TLS's p_memsz
Browse files Browse the repository at this point in the history
The code was added in r252352, probably to address some layout issues.
Actually PT_TLS's p_memsz doesn't need to be aligned on either variant.
ld.bfd doesn't do that.

In case of larger alignment (e.g. 64 for Android Bionic on AArch64, see
D62055), this may make the overhead smaller.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D62059

llvm-svn: 361029
  • Loading branch information
MaskRay authored and MrSidims committed May 24, 2019
1 parent 5601998 commit 3b381aa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
5 changes: 0 additions & 5 deletions lld/ELF/Writer.cpp
Expand Up @@ -2202,11 +2202,6 @@ template <class ELFT> void Writer<ELFT>::setPhdrs() {
// done on other operating systems.
P->p_align = std::max<uint64_t>(P->p_align, Config->Wordsize * 8);
}

// The TLS pointer goes after PT_TLS for variant 2 targets. At least glibc
// will align it, so round up the size to make sure the offsets are
// correct.
P->p_memsz = alignTo(P->p_memsz, P->p_align);
}
}
}
Expand Down
21 changes: 0 additions & 21 deletions lld/test/ELF/tls-align.s

This file was deleted.

0 comments on commit 3b381aa

Please sign in to comment.