1// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -file-headers -s -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols | FileCheck %s 2 3 .long 0 4text_def_int: 5 .long 0 6 7 .globl text_def_ext 8text_def_ext: 9 .long 0 10 11 .data 12 .long 0 13data_def_int: 14 .long 0 15 16 .globl data_def_ext 17data_def_ext: 18 .long 0 19 20// CHECK: File: <stdin> 21// CHECK: Format: Mach-O 32-bit i386 22// CHECK: Arch: i386 23// CHECK: AddressSize: 32bit 24// CHECK: MachHeader { 25// CHECK: Magic: Magic (0xFEEDFACE) 26// CHECK: CpuType: X86 (0x7) 27// CHECK: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3) 28// CHECK: FileType: Relocatable (0x1) 29// CHECK: NumOfLoadCommands: 4 30// CHECK: SizeOfLoadCommands: 312 31// CHECK: Flags [ (0x0) 32// CHECK: ] 33// CHECK: } 34// CHECK: Sections [ 35// CHECK: Section { 36// CHECK: Index: 0 37// CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) 38// CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) 39// CHECK: Address: 0x0 40// CHECK: Size: 0xC 41// CHECK: Offset: 340 42// CHECK: Alignment: 0 43// CHECK: RelocationOffset: 0x0 44// CHECK: RelocationCount: 0 45// CHECK: Type: 0x0 46// CHECK: Attributes [ (0x800000) 47// CHECK: PureInstructions (0x800000) 48// CHECK: ] 49// CHECK: Reserved1: 0x0 50// CHECK: Reserved2: 0x0 51// CHECK: } 52// CHECK: Section { 53// CHECK: Index: 1 54// CHECK: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00) 55// CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00) 56// CHECK: Address: 0xC 57// CHECK: Size: 0xC 58// CHECK: Offset: 352 59// CHECK: Alignment: 0 60// CHECK: RelocationOffset: 0x0 61// CHECK: RelocationCount: 0 62// CHECK: Type: 0x0 63// CHECK: Attributes [ (0x0) 64// CHECK: ] 65// CHECK: Reserved1: 0x0 66// CHECK: Reserved2: 0x0 67// CHECK: } 68// CHECK: ] 69// CHECK: Relocations [ 70// CHECK: ] 71// CHECK: Symbols [ 72// CHECK: Symbol { 73// CHECK: Name: text_def_int (27) 74// CHECK: Type: Section (0xE) 75// CHECK: Section: __text (0x1) 76// CHECK: RefType: UndefinedNonLazy (0x0) 77// CHECK: Flags [ (0x0) 78// CHECK: ] 79// CHECK: Value: 0x4 80// CHECK: } 81// CHECK: Symbol { 82// CHECK: Name: data_def_int (40) 83// CHECK: Type: Section (0xE) 84// CHECK: Section: __data (0x2) 85// CHECK: RefType: UndefinedNonLazy (0x0) 86// CHECK: Flags [ (0x0) 87// CHECK: ] 88// CHECK: Value: 0x10 89// CHECK: } 90// CHECK: Symbol { 91// CHECK: Name: data_def_ext (14) 92// CHECK: Extern 93// CHECK: Type: Section (0xE) 94// CHECK: Section: __data (0x2) 95// CHECK: RefType: UndefinedNonLazy (0x0) 96// CHECK: Flags [ (0x0) 97// CHECK: ] 98// CHECK: Value: 0x14 99// CHECK: } 100// CHECK: Symbol { 101// CHECK: Name: text_def_ext (1) 102// CHECK: Extern 103// CHECK: Type: Section (0xE) 104// CHECK: Section: __text (0x1) 105// CHECK: RefType: UndefinedNonLazy (0x0) 106// CHECK: Flags [ (0x0) 107// CHECK: ] 108// CHECK: Value: 0x8 109// CHECK: } 110// CHECK: ] 111// CHECK: Indirect Symbols { 112// CHECK: Number: 0 113// CHECK: Symbols [ 114// CHECK: ] 115// CHECK: } 116// CHECK: Segment { 117// CHECK: Cmd: LC_SEGMENT 118// CHECK: Name: 119// CHECK: Size: 192 120// CHECK: vmaddr: 0x0 121// CHECK: vmsize: 0x18 122// CHECK: fileoff: 340 123// CHECK: filesize: 24 124// CHECK: maxprot: rwx 125// CHECK: initprot: rwx 126// CHECK: nsects: 2 127// CHECK: flags: 0x0 128// CHECK: } 129// CHECK: Dysymtab { 130// CHECK: ilocalsym: 0 131// CHECK: nlocalsym: 2 132// CHECK: iextdefsym: 2 133// CHECK: nextdefsym: 2 134// CHECK: iundefsym: 4 135// CHECK: nundefsym: 0 136// CHECK: tocoff: 0 137// CHECK: ntoc: 0 138// CHECK: modtaboff: 0 139// CHECK: nmodtab: 0 140// CHECK: extrefsymoff: 0 141// CHECK: nextrefsyms: 0 142// CHECK: indirectsymoff: 0 143// CHECK: nindirectsyms: 0 144// CHECK: extreloff: 0 145// CHECK: nextrel: 0 146// CHECK: locreloff: 0 147// CHECK: nlocrel: 0 148// CHECK: } 149