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
15 // RUN: llvm-readobj -s %tout2 | FileCheck %s
20 .section .tdata,"awT",@progbits
24 .section .tbss,"awT",@nobits
28 .section .data.rel.ro,"aw",@progbits
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
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
43 // CHECK-NEXT: Address: 0x202000
44 // CHECK-NEXT: Offset: 0x2000
45 // CHECK-NEXT: Size: 4
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
54 // CHECK-NEXT: Address: 0x202010
55 // CHECK-NEXT: Offset: 0x2004
56 // CHECK-NEXT: Size: 16
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
64 // CHECK-NEXT: Address: 0x202004
65 // CHECK-NEXT: Offset: 0x2004
66 // CHECK-NEXT: Size: 4