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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 12:06:24 PDT 2015


ruiu added inline comments.

================
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)
----------------
Bigcheese wrote:
> 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.
That's still a user code bug, no? I'm not convinced unless it is very prevalent issue that we had to take care of this specially.


http://reviews.llvm.org/D13763





More information about the llvm-commits mailing list