[lld] dc21cb5 - [ELF, test] Test STT_TLS and relocation without PT_TLS
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 12 11:25:51 PDT 2024
Author: Fangrui Song
Date: 2024-08-12T11:25:46-07:00
New Revision: dc21cb5cc74fdff18418092570230cd980cafa27
URL: https://github.com/llvm/llvm-project/commit/dc21cb5cc74fdff18418092570230cd980cafa27
DIFF: https://github.com/llvm/llvm-project/commit/dc21cb5cc74fdff18418092570230cd980cafa27.diff
LOG: [ELF,test] Test STT_TLS and relocation without PT_TLS
Added:
lld/test/ELF/linkerscript/phdrs-no-tls.test
Modified:
Removed:
################################################################################
diff --git a/lld/test/ELF/linkerscript/phdrs-no-tls.test b/lld/test/ELF/linkerscript/phdrs-no-tls.test
new file mode 100644
index 00000000000000..1d5d726b6c9e10
--- /dev/null
+++ b/lld/test/ELF/linkerscript/phdrs-no-tls.test
@@ -0,0 +1,30 @@
+## Test STT_TLS and relocations without PT_TLS. See also invalid/tls-symbol.s.
+# REQUIRES: x86
+# RUN: rm -rf %t && split-file %s %t && cd %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
+# RUN: not ld.lld -T a.lds a.o --noinhibit-exec 2>&1 | FileCheck %s --implicit-check-not=warning:
+
+# CHECK: error: a.o has an STT_TLS symbol but doesn't have an SHF_TLS section
+
+#--- a.lds
+PHDRS {
+ text PT_LOAD FLAGS(5);
+ data PT_LOAD FLAGS(6);
+}
+
+SECTIONS {
+ . = SIZEOF_HEADERS;
+ .text : { *(.text .text.*) } :text
+ .data : { *(.data .data.*) } :data
+}
+
+#--- a.s
+.globl _start
+_start:
+ movl %fs:a at TPOFF, %eax
+ movl %fs:b at TPOFF, %eax
+
+.section .tbss,"awT"
+a:
+b:
+ .long 0
More information about the llvm-commits
mailing list