[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:16 PDT 2026


================
@@ -0,0 +1,52 @@
+# REQUIRES: x86
+## Test that an explicit address expression on a .tbss section is respected.
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+
+## Test that an explicit address on a tbss section is honored.
+# RUN: echo 'SECTIONS { \
+# RUN:   . = SIZEOF_HEADERS; \
+# RUN:   .text : { *(.text) } \
+# RUN:   .tbss 0x1000 : { *(.tbss) } \
+# RUN:   .data : { *(.data) } \
----------------
smithp35 wrote:

The source code below your change has a comment:
```
// Allow consecutive SHF_TLS SHT_NOBITS output sections. The address range
// starts from the end address of the previous tbss section.
```
Would be useful to add a test that shows how this works when the initial tbss section has a defined address.

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


More information about the llvm-commits mailing list