2 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
4 # RUN: llvm-readobj --section-headers --macho-segment %t | FileCheck %s
6 ## Check that __bss takes up zero file size, is at file offset zero, and appears
7 ## at the end of its segment. Also check that __tbss is placed immediately
9 ## Zerofill sections in other segments (i.e. not __DATA) should also be placed
13 # CHECK-NEXT: Name: __data
14 # CHECK-NEXT: Segment: __DATA
15 # CHECK-NEXT: Address:
16 # CHECK-NEXT: Size: 0x8
17 # CHECK-NEXT: Offset: 4096
18 # CHECK-NEXT: Alignment: 0
19 # CHECK-NEXT: RelocationOffset: 0x0
20 # CHECK-NEXT: RelocationCount: 0
21 # CHECK-NEXT: Type: Regular (0x0)
22 # CHECK-NEXT: Attributes [ (0x0)
24 # CHECK-NEXT: Reserved1: 0x0
25 # CHECK-NEXT: Reserved2: 0x0
26 # CHECK-NEXT: Reserved3: 0x0
29 # CHECK-NEXT: Name: __thread_bss
30 # CHECK-NEXT: Segment: __DATA
31 # CHECK-NEXT: Address:
32 # CHECK-NEXT: Size: 0x4
33 # CHECK-NEXT: Offset: 0
34 # CHECK-NEXT: Alignment: 0
35 # CHECK-NEXT: RelocationOffset: 0x0
36 # CHECK-NEXT: RelocationCount: 0
37 # CHECK-NEXT: Type: ThreadLocalZerofill (0x12)
38 # CHECK-NEXT: Attributes [ (0x0)
40 # CHECK-NEXT: Reserved1: 0x0
41 # CHECK-NEXT: Reserved2: 0x0
42 # CHECK-NEXT: Reserved3: 0x0
45 # CHECK-NEXT: Name: __bss
46 # CHECK-NEXT: Segment: __DATA
47 # CHECK-NEXT: Address:
48 # CHECK-NEXT: Size: 0x10000
49 # CHECK-NEXT: Offset: 0
50 # CHECK-NEXT: Alignment: 0
51 # CHECK-NEXT: RelocationOffset: 0x0
52 # CHECK-NEXT: RelocationCount: 0
53 # CHECK-NEXT: Type: ZeroFill (0x1)
54 # CHECK-NEXT: Attributes [ (0x0)
56 # CHECK-NEXT: Reserved1: 0x0
57 # CHECK-NEXT: Reserved2: 0x0
58 # CHECK-NEXT: Reserved3: 0x0
61 # CHECK-NEXT: Name: foo
62 # CHECK-NEXT: Segment: FOO
63 # CHECK-NEXT: Address:
64 # CHECK-NEXT: Size: 0x8
65 # CHECK-NEXT: Offset: 8192
66 # CHECK-NEXT: Alignment: 0
67 # CHECK-NEXT: RelocationOffset: 0x0
68 # CHECK-NEXT: RelocationCount: 0
69 # CHECK-NEXT: Type: Regular (0x0)
70 # CHECK-NEXT: Attributes [ (0x0)
72 # CHECK-NEXT: Reserved1: 0x0
73 # CHECK-NEXT: Reserved2: 0x0
74 # CHECK-NEXT: Reserved3: 0x0
77 # CHECK-NEXT: Name: bss
78 # CHECK-NEXT: Segment: FOO
79 # CHECK-NEXT: Address:
80 # CHECK-NEXT: Size: 0x8
81 # CHECK-NEXT: Offset: 0
82 # CHECK-NEXT: Alignment: 0
83 # CHECK-NEXT: RelocationOffset: 0x0
84 # CHECK-NEXT: RelocationCount: 0
85 # CHECK-NEXT: Type: ZeroFill (0x1)
86 # CHECK-NEXT: Attributes [ (0x0)
88 # CHECK-NEXT: Reserved1: 0x0
89 # CHECK-NEXT: Reserved2: 0x0
90 # CHECK-NEXT: Reserved3: 0x0
95 # CHECK-NEXT: vmsize: 0x11000
96 # CHECK-NEXT: fileoff:
97 # CHECK-NEXT: filesize: 4096
101 # CHECK-NEXT: vmaddr:
102 # CHECK-NEXT: vmsize: 0x9000
103 # CHECK-NEXT: fileoff:
104 # CHECK-NEXT: filesize: 4096
122 .zerofill FOO,bss,_zero_foo,0x8000