summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-05-17 12:48:53 +0000
committerFangrui Song <maskray@google.com>2019-05-17 12:48:53 +0000
commitf3dccc64af5d7fc10d30d37c5eaa535373287964 (patch)
treeaf73e80842dc3cd61d4767f2e6ca29905ce787bd
parenta510b570c281ba87e43ba349041802457c7a6151 (diff)
downloadbcm5719-llvm-f3dccc64af5d7fc10d30d37c5eaa535373287964.tar.gz
bcm5719-llvm-f3dccc64af5d7fc10d30d37c5eaa535373287964.zip
[ELF] Don't align PT_TLS's p_memsz
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
-rw-r--r--lld/ELF/Writer.cpp5
-rw-r--r--lld/test/ELF/tls-align.s21
2 files changed, 0 insertions, 26 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index cfc131af279..b18c1cfbc6e 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -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);
}
}
}
diff --git a/lld/test/ELF/tls-align.s b/lld/test/ELF/tls-align.s
deleted file mode 100644
index 1f7cfbbcb72..00000000000
--- a/lld/test/ELF/tls-align.s
+++ /dev/null
@@ -1,21 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-// RUN: ld.lld %t -o %tout -shared
-// RUN: llvm-readobj -l %tout | FileCheck %s
-
- .section .tbss,"awT",@nobits
- .align 8
- .long 0
-
-// CHECK: ProgramHeader {
-// CHECK: Type: PT_TLS
-// CHECK-NEXT: Offset:
-// CHECK-NEXT: VirtualAddress:
-// CHECK-NEXT: PhysicalAddress:
-// CHECK-NEXT: FileSize: 0
-// CHECK-NEXT: MemSize: 8
-// CHECK-NEXT: Flags [
-// CHECK-NEXT: PF_R (0x4)
-// CHECK-NEXT: ]
-// CHECK-NEXT: Alignment: 8
-// CHECK-NEXT: }
OpenPOWER on IntegriCloud