]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/tls-offset.s
Vendor import of lld trunk r302418:
[FreeBSD/FreeBSD.git] / test / ELF / tls-offset.s
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3 // RUN: ld.lld %t -o %tout
4 // RUN: llvm-readobj -s %tout | FileCheck %s
5 // RUN: echo "SECTIONS { \
6 // RUN:   . = 0x201000; \
7 // RUN:   .text : { *(.text) } \
8 // RUN:   . = 0x202000; \
9 // RUN:   .tdata : { *(.tdata) } \
10 // RUN:   .tbss : { *(.tbss) } \
11 // RUN:   .data.rel.ro : { *(.data.rel.ro) } \
12 // RUN: }" > %t.script
13 // RUN: ld.lld -T %t.script %t -o %tout2
14 // RUN: echo SCRIPT
15 // RUN: llvm-readobj -s %tout2 | FileCheck %s
16         .global _start
17 _start:
18         retq
19
20         .section        .tdata,"awT",@progbits
21         .align  4
22         .long   42
23
24         .section        .tbss,"awT",@nobits
25         .align  16
26         .zero 16
27
28         .section        .data.rel.ro,"aw",@progbits
29         .long 1
30
31
32 // Test that .tbss doesn't show up in the offset or in the address. If this
33 // gets out of sync what we get a runtime is different from what the section
34 // table says.
35
36 // CHECK:      Name: .tdata
37 // CHECK-NEXT: Type: SHT_PROGBITS
38 // CHECK-NEXT: Flags [
39 // CHECK-NEXT:   SHF_ALLOC
40 // CHECK-NEXT:   SHF_TLS
41 // CHECK-NEXT:   SHF_WRITE
42 // CHECK-NEXT: ]
43 // CHECK-NEXT: Address: 0x202000
44 // CHECK-NEXT: Offset: 0x2000
45 // CHECK-NEXT: Size: 4
46
47 // CHECK:      Name: .tbss
48 // CHECK-NEXT: Type: SHT_NOBITS
49 // CHECK-NEXT: Flags [
50 // CHECK-NEXT:   SHF_ALLOC
51 // CHECK-NEXT:   SHF_TLS
52 // CHECK-NEXT:   SHF_WRITE
53 // CHECK-NEXT: ]
54 // CHECK-NEXT: Address: 0x202010
55 // CHECK-NEXT: Offset: 0x2004
56 // CHECK-NEXT: Size: 16
57
58 // CHECK:      Name: .data.rel.ro
59 // CHECK-NEXT: Type: SHT_PROGBITS
60 // CHECK-NEXT: Flags [
61 // CHECK-NEXT:   SHF_ALLOC
62 // CHECK-NEXT:   SHF_WRITE
63 // CHECK-NEXT: ]
64 // CHECK-NEXT: Address: 0x202004
65 // CHECK-NEXT: Offset: 0x2004
66 // CHECK-NEXT: Size: 4