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 3 .byte 0 4 5 // This file has size 2, the tail padding doesn't count. 6 .zerofill __DATA, __bss, sym_a, 1 7 8 // CHECK: File: <stdin> 9 // CHECK: Format: Mach-O 32-bit i386 10 // CHECK: Arch: i386 11 // CHECK: AddressSize: 32bit 12 // CHECK: MachHeader { 13 // CHECK: Magic: Magic (0xFEEDFACE) 14 // CHECK: CpuType: X86 (0x7) 15 // CHECK: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3) 16 // CHECK: FileType: Relocatable (0x1) 17 // CHECK: NumOfLoadCommands: 4 18 // CHECK: SizeOfLoadCommands: 312 19 // CHECK: Flags [ (0x0) 20 // CHECK: ] 21 // CHECK: } 22 // CHECK: Sections [ 23 // CHECK: Section { 24 // CHECK: Index: 0 25 // CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) 26 // CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) 27 // CHECK: Address: 0x0 28 // CHECK: Size: 0x1 29 // CHECK: Offset: 340 30 // CHECK: Alignment: 0 31 // CHECK: RelocationOffset: 0x0 32 // CHECK: RelocationCount: 0 33 // CHECK: Type: 0x0 34 // CHECK: Attributes [ (0x800000) 35 // CHECK: PureInstructions (0x800000) 36 // CHECK: ] 37 // CHECK: Reserved1: 0x0 38 // CHECK: Reserved2: 0x0 39 // CHECK: SectionData ( 40 // CHECK: 0000: 00 |.| 41 // CHECK: ) 42 // CHECK: } 43 // CHECK: Section { 44 // CHECK: Index: 1 45 // CHECK: Name: __bss (5F 5F 62 73 73 00 00 00 00 00 00 00 00 00 00 00) 46 // CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00) 47 // CHECK: Address: 0x1 48 // CHECK: Size: 0x1 49 // CHECK: Offset: 0 50 // CHECK: Alignment: 0 51 // CHECK: RelocationOffset: 0x0 52 // CHECK: RelocationCount: 0 53 // CHECK: Type: LocReloc (0x1) 54 // CHECK: Attributes [ (0x0) 55 // CHECK: ] 56 // CHECK: Reserved1: 0x0 57 // CHECK: Reserved2: 0x0 58 // CHECK: } 59 // CHECK: ] 60 // CHECK: Relocations [ 61 // CHECK: ] 62 // CHECK: Symbols [ 63 // CHECK: Symbol { 64 // CHECK: Name: sym_a (1) 65 // CHECK: Type: Section (0xE) 66 // CHECK: Section: __bss (0x2) 67 // CHECK: RefType: UndefinedNonLazy (0x0) 68 // CHECK: Flags [ (0x0) 69 // CHECK: ] 70 // CHECK: Value: 0x1 71 // CHECK: } 72 // CHECK: ] 73 // CHECK: Indirect Symbols { 74 // CHECK: Number: 0 75 // CHECK: Symbols [ 76 // CHECK: ] 77 // CHECK: } 78 // CHECK: Segment { 79 // CHECK: Cmd: LC_SEGMENT 80 // CHECK: Name: 81 // CHECK: Size: 192 82 // CHECK: vmaddr: 0x0 83 // CHECK: vmsize: 0x2 84 // CHECK: fileoff: 340 85 // CHECK: filesize: 1 86 // CHECK: maxprot: rwx 87 // CHECK: initprot: rwx 88 // CHECK: nsects: 2 89 // CHECK: flags: 0x0 90 // CHECK: } 91 // CHECK: Dysymtab { 92 // CHECK: ilocalsym: 0 93 // CHECK: nlocalsym: 1 94 // CHECK: iextdefsym: 1 95 // CHECK: nextdefsym: 0 96 // CHECK: iundefsym: 1 97 // CHECK: nundefsym: 0 98 // CHECK: tocoff: 0 99 // CHECK: ntoc: 0 100 // CHECK: modtaboff: 0 101 // CHECK: nmodtab: 0 102 // CHECK: extrefsymoff: 0 103 // CHECK: nextrefsyms: 0 104 // CHECK: indirectsymoff: 0 105 // CHECK: nindirectsyms: 0 106 // CHECK: extreloff: 0 107 // CHECK: nextrel: 0 108 // CHECK: locreloff: 0 109 // CHECK: nlocrel: 0 110 // CHECK: } 111