[lld] [lld][ELF] Allow explicit address expressions on .tbss output sections (PR #196447)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 06:20:15 PDT 2026


https://github.com/smithp35 commented:

Looks reasonable to me. I'll need to double check the GNU ld behaviour.

As an aside I'm curious about the use case for assigning an address to .tbss. Given that TLS is normally instantiated per-thread, its static link time isn't normally important, it is also normally important that it follows .tdata as a static-linker will base the offset of the thread pointer from the start of .tdata - if .tdata exists. At a guess this is a single-threaded application, with no .tdata so this is a way of instantiating the TLS directly?

I'd also expect that with 0 .tdata size you should be able to do:
```
.tdata address : { *(.tdata) } /* could be zero size */
.tbss : { *(.tbss) } /* follows .tdata */
```

https://github.com/llvm/llvm-project/pull/196447


More information about the llvm-commits mailing list