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