14010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar@ RUN: llvm-mc -n -triple thumbv7-apple-darwin10 %s -filetype=obj -o %t.obj
2cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ RUN: llvm-readobj -file-headers -s -sd -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols < %t.obj > %t.dump
34010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar@ RUN: FileCheck < %t.dump %s
44010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar
54010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.syntax unified
64010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.section	__TEXT,__text,regular,pure_instructions
74010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.globl	_main
84010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.align	2
94010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.code	16
104010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.thumb_func	_main
114010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar_main:
124010dd72b81b760daaa0361084de6dca8ed86fa1Daniel DunbarLPC0_0:
134010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	blx	_printf
144010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.align	2
154010dd72b81b760daaa0361084de6dca8ed86fa1Daniel DunbarLCPI0_0:
164010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.long	L_.str-(LPC0_0+4)
174010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar
184010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.section	__TEXT,__cstring,cstring_literals
194010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.align	2
204010dd72b81b760daaa0361084de6dca8ed86fa1Daniel DunbarL_.str:
214010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar	.asciz	 "s0"
224010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar
234010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar.subsections_via_symbols
244010dd72b81b760daaa0361084de6dca8ed86fa1Daniel Dunbar
25cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: File: <stdin>
26cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: Format: Mach-O arm
27cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: Arch: arm
28cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: AddressSize: 32bit
29cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: MachHeader {
30cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Magic: Magic (0xFEEDFACE)
31cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   CpuType: Arm (0xC)
32cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   CpuSubType: CPU_SUBTYPE_ARM_V7 (0x9)
33cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   FileType: Relocatable (0x1)
34cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   NumOfLoadCommands: 4
35cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   SizeOfLoadCommands: 312
36cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Flags [ (0x2000)
37cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     MH_SUBSECTIONS_VIA_SYMBOLS (0x2000)
38cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   ]
39cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: }
40cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: Sections [
41cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Section {
42cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Index: 0
43cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
44cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
45cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Address: 0x0
46cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Size: 0x8
47cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Offset: 340
48cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Alignment: 2
49cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     RelocationOffset: 0x160
50cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     RelocationCount: 3
51cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Type: 0x0
52cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Attributes [ (0x800004)
53cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:       PureInstructions (0x800000)
54cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:       SomeInstructions (0x4)
55cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     ]
56cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Reserved1: 0x0
57cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Reserved2: 0x0
58cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     SectionData (
59cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:       0000: FFF7FEEF 04000000                    |........|
60cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     )
61cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   }
62cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Section {
63cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Index: 1
64cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00)
65cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
66cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Address: 0x8
67cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Size: 0x3
68cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Offset: 348
69cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Alignment: 2
70cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     RelocationOffset: 0x0
71cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     RelocationCount: 0
72cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Type: ExtReloc (0x2)
73cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Attributes [ (0x0)
74cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     ]
75cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Reserved1: 0x0
76cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Reserved2: 0x0
77cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     SectionData (
78cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:       0000: 733000                               |s0.|
79cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     )
80cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   }
81cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: ]
82cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: Relocations [
83cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Section __text {
84cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     0x4 0 2 n/a ARM_RELOC_SECTDIFF 1 0x8
85cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     0x0 0 2 n/a ARM_RELOC_PAIR 1 0x0
86cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     0x0 1 2 1 ARM_THUMB_RELOC_BR22 0 _printf
87cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   }
88cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: ]
89cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: Symbols [
90cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Symbol {
91cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Name: _main (1)
92cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Extern
93cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Type: Section (0xE)
94cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Section: __text (0x1)
95cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     RefType: 0x8
96cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Flags [ (0x0)
97cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     ]
98cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Value: 0x0
99cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   }
100cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Symbol {
101cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Name: _printf (7)
102cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Extern
103cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Type: Undef (0x0)
104cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Section:  (0x0)
105cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     RefType: UndefinedNonLazy (0x0)
106cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Flags [ (0x0)
107cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     ]
108cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:     Value: 0x0
109cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   }
110cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: ]
111cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: Indirect Symbols {
112cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Number: 0
113cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Symbols [
114cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   ]
115cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: }
116cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: Segment {
117cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Cmd: LC_SEGMENT
118cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Name:
119cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   Size: 192
120cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   vmaddr: 0x0
121cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   vmsize: 0xB
122cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   fileoff: 340
123cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   filesize: 11
124cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   maxprot: rwx
125cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   initprot: rwx
126cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   nsects: 2
127cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   flags: 0x0
128cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: }
129cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: Dysymtab {
130cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   ilocalsym: 0
131cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   nlocalsym: 0
132cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   iextdefsym: 0
133cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   nextdefsym: 1
134cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   iundefsym: 1
135cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   nundefsym: 1
136cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   tocoff: 0
137cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   ntoc: 0
138cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   modtaboff: 0
139cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   nmodtab: 0
140cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   extrefsymoff: 0
141cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   nextrefsyms: 0
142cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   indirectsymoff: 0
143cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   nindirectsyms: 0
144cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   extreloff: 0
145cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   nextrel: 0
146cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   locreloff: 0
147cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK:   nlocrel: 0
148cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar@ CHECK: }
149