153 lines · plain
1// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj --file-headers -S --sd -r --symbols --macho-segment --macho-dysymtab --macho-indirect-symbols - | FileCheck %s2 3 // FIXME: We don't get the order right currently, the assembler first4 // orders the symbols, then assigns addresses. :(5.if 0 6 .lcomm sym_lcomm_B, 47 .lcomm sym_lcomm_C, 4, 4 8 .lcomm sym_lcomm_A, 4, 39 .lcomm sym_lcomm_D, 410 .globl sym_lcomm_D11 .globl sym_lcomm_C12.else13 .lcomm sym_lcomm_C, 4, 4 14 .lcomm sym_lcomm_D, 415 .globl sym_lcomm_D16 .globl sym_lcomm_C17 18 .lcomm sym_lcomm_A, 4, 319 .lcomm sym_lcomm_B, 420.endif21 22// CHECK: File: <stdin>23// CHECK: Format: Mach-O 32-bit i38624// CHECK: Arch: i38625// CHECK: AddressSize: 32bit26// 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: 432// CHECK: SizeOfLoadCommands: 31233// CHECK: Flags [ (0x0)34// CHECK: ]35// CHECK: }36// CHECK: Sections [37// CHECK: Section {38// CHECK: Index: 039// 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: 0x042// CHECK: Size: 0x043// CHECK: Offset: 34044// CHECK: Alignment: 045// CHECK: RelocationOffset: 0x046// CHECK: RelocationCount: 047// CHECK: Type: Regular (0x0)48// CHECK: Attributes [ (0x800000)49// CHECK: PureInstructions (0x800000)50// CHECK: ]51// CHECK: Reserved1: 0x052// CHECK: Reserved2: 0x053// CHECK: SectionData (54// CHECK: )55// CHECK: }56// CHECK: Section {57// CHECK: Index: 158// 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: 0x061// CHECK: Size: 0x1062// CHECK: Offset: 063// CHECK: Alignment: 464// CHECK: RelocationOffset: 0x065// CHECK: RelocationCount: 066// CHECK: Type: ZeroFill (0x1)67// CHECK: Attributes [ (0x0)68// CHECK: ]69// CHECK: Reserved1: 0x070// CHECK: Reserved2: 0x071// 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: 0x884// 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: 0xC93// CHECK: }94// CHECK: Symbol {95// CHECK: Name: sym_lcomm_C (13)96// CHECK: Extern97// CHECK: Type: Section (0xE)98// CHECK: Section: __bss (0x2)99// CHECK: RefType: UndefinedNonLazy (0x0)100// CHECK: Flags [ (0x0)101// CHECK: ]102// CHECK: Value: 0x0103// CHECK: }104// CHECK: Symbol {105// CHECK: Name: sym_lcomm_D (1)106// CHECK: Extern107// CHECK: Type: Section (0xE)108// CHECK: Section: __bss (0x2)109// CHECK: RefType: UndefinedNonLazy (0x0)110// CHECK: Flags [ (0x0)111// CHECK: ]112// CHECK: Value: 0x4113// CHECK: }114// CHECK: ]115// CHECK: Indirect Symbols {116// CHECK: Number: 0117// CHECK: Symbols [118// CHECK: ]119// CHECK: }120// CHECK: Segment {121// CHECK: Cmd: LC_SEGMENT122// CHECK: Name: 123// CHECK: Size: 192124// CHECK: vmaddr: 0x0125// CHECK: vmsize: 0x10126// CHECK: fileoff: 340127// CHECK: filesize: 0128// CHECK: maxprot: rwx129// CHECK: initprot: rwx130// CHECK: nsects: 2131// CHECK: flags: 0x0132// CHECK: }133// CHECK: Dysymtab {134// CHECK: ilocalsym: 0135// CHECK: nlocalsym: 2136// CHECK: iextdefsym: 2137// CHECK: nextdefsym: 2138// CHECK: iundefsym: 4139// CHECK: nundefsym: 0140// CHECK: tocoff: 0141// CHECK: ntoc: 0142// CHECK: modtaboff: 0143// CHECK: nmodtab: 0144// CHECK: extrefsymoff: 0145// CHECK: nextrefsyms: 0146// CHECK: indirectsymoff: 0147// CHECK: nindirectsyms: 0148// CHECK: extreloff: 0149// CHECK: nextrel: 0150// CHECK: locreloff: 0151// CHECK: nlocrel: 0152// CHECK: }153