[PATCH] D13763: [lld][elf2] Sort allocated TLS sections at the start of the R/W PT_LOAD.

Michael Spencer via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 11:55:11 PDT 2015


Bigcheese marked an inline comment as done.

================
Comment at: ELF/Writer.cpp:300-302
@@ -299,1 +299,5 @@
 
+  // The TLS spec says that the linker can assume that TLS sections are R/W. Do
+  // this so we can generate a minimal PT_TLS Phdr. Non-allocated TLS sections
+  // are ignored because they shouldn't be in the middle of allocated sections.
+  if (AFlags & SHF_TLS && AFlags & SHF_ALLOC)
----------------
ruiu wrote:
> It sounds like a compiler bug if it emits .tbss or .tdata without the writable bit. Do we actually care about this case?
There's assembly. It also makes layout a bit simpler, as you can assume all TLS sections are together, and there's no good reason to reject it.


http://reviews.llvm.org/D13763





More information about the llvm-commits mailing list