[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) } \
+# RUN: }' > %t.lds
+# RUN: ld.lld -T %t.lds %t.o -o %t
+# RUN: llvm-readelf -S %t | FileCheck %s
+
+# CHECK: .tbss NOBITS 0000000000001000 {{[0-9a-f]+}} 000004
+
+## Test that an expression (not just a constant) works for tbss address.
----------------
smithp35 wrote:
I don't think this test is necessary. The only difference is the use of an expression, and that isn't related to the source code change made.
https://github.com/llvm/llvm-project/pull/196447
More information about the llvm-commits
mailing list