Skip to content

Commit dc21cb5

Browse files
committed
[ELF,test] Test STT_TLS and relocation without PT_TLS
1 parent ee5d572 commit dc21cb5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Test STT_TLS and relocations without PT_TLS. See also invalid/tls-symbol.s.
2+
# REQUIRES: x86
3+
# RUN: rm -rf %t && split-file %s %t && cd %t
4+
# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
5+
# RUN: not ld.lld -T a.lds a.o --noinhibit-exec 2>&1 | FileCheck %s --implicit-check-not=warning:
6+
7+
# CHECK: error: a.o has an STT_TLS symbol but doesn't have an SHF_TLS section
8+
9+
#--- a.lds
10+
PHDRS {
11+
text PT_LOAD FLAGS(5);
12+
data PT_LOAD FLAGS(6);
13+
}
14+
15+
SECTIONS {
16+
. = SIZEOF_HEADERS;
17+
.text : { *(.text .text.*) } :text
18+
.data : { *(.data .data.*) } :data
19+
}
20+
21+
#--- a.s
22+
.globl _start
23+
_start:
24+
movl %fs:a@TPOFF, %eax
25+
movl %fs:b@TPOFF, %eax
26+
27+
.section .tbss,"awT"
28+
a:
29+
b:
30+
.long 0

0 commit comments

Comments
 (0)