• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -file-headers -s -sd -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols | FileCheck %s
2
3nop
4	.section	__TEXT,__StaticInit,regular,pure_instructions
5	calll	foo
6
7// CHECK: File: <stdin>
8// CHECK: Format: Mach-O 32-bit i386
9// CHECK: Arch: i386
10// CHECK: AddressSize: 32bit
11// CHECK: MachHeader {
12// CHECK:   Magic: Magic (0xFEEDFACE)
13// CHECK:   CpuType: X86 (0x7)
14// CHECK:   CpuSubType: CPU_SUBTYPE_I386_ALL (0x3)
15// CHECK:   FileType: Relocatable (0x1)
16// CHECK:   NumOfLoadCommands: 4
17// CHECK:   SizeOfLoadCommands: 312
18// CHECK:   Flags [ (0x0)
19// CHECK:   ]
20// CHECK: }
21// CHECK: Sections [
22// CHECK:   Section {
23// CHECK:     Index: 0
24// CHECK:     Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
25// CHECK:     Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
26// CHECK:     Address: 0x0
27// CHECK:     Size: 0x1
28// CHECK:     Offset: 340
29// CHECK:     Alignment: 0
30// CHECK:     RelocationOffset: 0x0
31// CHECK:     RelocationCount: 0
32// CHECK:     Type: 0x0
33// CHECK:     Attributes [ (0x800004)
34// CHECK:       PureInstructions (0x800000)
35// CHECK:       SomeInstructions (0x4)
36// CHECK:     ]
37// CHECK:     Reserved1: 0x0
38// CHECK:     Reserved2: 0x0
39// CHECK:     SectionData (
40// CHECK:       0000: 90                                   |.|
41// CHECK:     )
42// CHECK:   }
43// CHECK:   Section {
44// CHECK:     Index: 1
45// CHECK:     Name: __StaticInit (5F 5F 53 74 61 74 69 63 49 6E 69 74 00 00 00 00)
46// CHECK:     Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
47// CHECK:     Address: 0x1
48// CHECK:     Size: 0x5
49// CHECK:     Offset: 341
50// CHECK:     Alignment: 0
51// CHECK:     RelocationOffset: 0x15C
52// CHECK:     RelocationCount: 1
53// CHECK:     Type: 0x0
54// CHECK:     Attributes [ (0x800004)
55// CHECK:       PureInstructions (0x800000)
56// CHECK:       SomeInstructions (0x4)
57// CHECK:     ]
58// CHECK:     Reserved1: 0x0
59// CHECK:     Reserved2: 0x0
60// CHECK:     SectionData (
61// CHECK:       0000: E8FAFFFF FF                          |.....|
62// CHECK:     )
63// CHECK:   }
64// CHECK: ]
65// CHECK: Relocations [
66// CHECK:   Section __StaticInit {
67// CHECK:     0x1 1 2 1 GENERIC_RELOC_VANILLA 0 foo
68// CHECK:   }
69// CHECK: ]
70// CHECK: Symbols [
71// CHECK:   Symbol {
72// CHECK:     Name: foo (1)
73// CHECK:     Extern
74// CHECK:     Type: Undef (0x0)
75// CHECK:     Section:  (0x0)
76// CHECK:     RefType: UndefinedNonLazy (0x0)
77// CHECK:     Flags [ (0x0)
78// CHECK:     ]
79// CHECK:     Value: 0x0
80// CHECK:   }
81// CHECK: ]
82// CHECK: Indirect Symbols {
83// CHECK:   Number: 0
84// CHECK:   Symbols [
85// CHECK:   ]
86// CHECK: }
87// CHECK: Segment {
88// CHECK:   Cmd: LC_SEGMENT
89// CHECK:   Name:
90// CHECK:   Size: 192
91// CHECK:   vmaddr: 0x0
92// CHECK:   vmsize: 0x6
93// CHECK:   fileoff: 340
94// CHECK:   filesize: 6
95// CHECK:   maxprot: rwx
96// CHECK:   initprot: rwx
97// CHECK:   nsects: 2
98// CHECK:   flags: 0x0
99// CHECK: }
100// CHECK: Dysymtab {
101// CHECK:   ilocalsym: 0
102// CHECK:   nlocalsym: 0
103// CHECK:   iextdefsym: 0
104// CHECK:   nextdefsym: 0
105// CHECK:   iundefsym: 0
106// CHECK:   nundefsym: 1
107// CHECK:   tocoff: 0
108// CHECK:   ntoc: 0
109// CHECK:   modtaboff: 0
110// CHECK:   nmodtab: 0
111// CHECK:   extrefsymoff: 0
112// CHECK:   nextrefsyms: 0
113// CHECK:   indirectsymoff: 0
114// CHECK:   nindirectsyms: 0
115// CHECK:   extreloff: 0
116// CHECK:   nextrel: 0
117// CHECK:   locreloff: 0
118// CHECK:   nlocrel: 0
119// CHECK: }
120