[PATCH] D55864: [elfabi] Write program headers, .dynamic, .dynstr, and .shstrtab

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 21:54:30 PDT 2019


MaskRay added inline comments.


================
Comment at: llvm/tools/llvm-elfabi/ELFObjHandler.cpp:599
+    // Define the TLS section.
+    TlsSec.Name = ".tls";
+    TlsSec.Shdr = [this](Elf_Shdr& Shdr) {
----------------
jakehehrlich wrote:
> MaskRay wrote:
> > Which architecture uses the section name `.tls`?
> > 
> > Did you mean `.tbss`?
> .tbss would imply that this is writable when it isn't. In practice read-only data is already thread safe so there is no need for a read only TLS section. There is also in general no reason to have a read-only NOBITS section since the content is just zeros. This means there aren't good names to use for what I'm doing here. These section names don't matter functionally however. I'm open to many other names. I just went for short names where a name used in the wild didn't exist.
> In practice read-only data is already thread safe so there is no need for a read only TLS section. 

So why do you need the non-writable `.tss`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55864/new/

https://reviews.llvm.org/D55864





More information about the llvm-commits mailing list