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 .reference sym_ref_A 4 .reference sym_ref_def_A 5sym_ref_def_A: 6sym_ref_def_C: 7 .reference sym_ref_def_C 8 .reference sym_ref_def_D 9 .globl sym_ref_def_D 10 .globl sym_ref_def_E 11 .reference sym_ref_def_E 12 13 .weak_reference sym_weak_ref_A 14 .weak_reference sym_weak_ref_def_A 15sym_weak_ref_def_A: 16sym_weak_ref_def_B: 17 .weak_reference sym_weak_ref_def_B 18 19 .data 20 .globl sym_weak_def_A 21 .weak_definition sym_weak_def_A 22sym_weak_def_A: 23sym_weak_def_B: 24 .weak_definition sym_weak_def_B 25 .globl sym_weak_def_B 26 .weak_definition sym_weak_def_C 27sym_weak_def_C: 28 .globl sym_weak_def_C 29 30 .lazy_reference sym_lazy_ref_A 31 .lazy_reference sym_lazy_ref_B 32sym_lazy_ref_B: 33sym_lazy_ref_C: 34 .lazy_reference sym_lazy_ref_C 35 .lazy_reference sym_lazy_ref_D 36 .globl sym_lazy_ref_D 37 .globl sym_lazy_ref_E 38 .lazy_reference sym_lazy_ref_E 39 40 .private_extern sym_private_ext_A 41 .private_extern sym_private_ext_B 42sym_private_ext_B: 43sym_private_ext_C: 44 .private_extern sym_private_ext_C 45 .private_extern sym_private_ext_D 46 .globl sym_private_ext_D 47 .globl sym_private_ext_E 48 .private_extern sym_private_ext_E 49 50 .no_dead_strip sym_no_dead_strip_A 51 52sym_symbol_resolver_A: 53 .symbol_resolver sym_symbol_resolver_A 54 55 .reference sym_ref_A 56 .desc sym_ref_A, 1 57 .desc sym_ref_A, 0x1234 58 59 .desc sym_desc_flags,0x47 60sym_desc_flags: 61 62// CHECK: File: <stdin> 63// CHECK: Format: Mach-O 32-bit i386 64// CHECK: Arch: i386 65// CHECK: AddressSize: 32bit 66// CHECK: MachHeader { 67// CHECK: Magic: Magic (0xFEEDFACE) 68// CHECK: CpuType: X86 (0x7) 69// CHECK: CpuSubType: CPU_SUBTYPE_I386_ALL (0x3) 70// CHECK: FileType: Relocatable (0x1) 71// CHECK: NumOfLoadCommands: 4 72// CHECK: SizeOfLoadCommands: 312 73// CHECK: Flags [ (0x0) 74// CHECK: ] 75// CHECK: } 76// CHECK: Sections [ 77// CHECK: Section { 78// CHECK: Index: 0 79// CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) 80// CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) 81// CHECK: Address: 0x0 82// CHECK: Size: 0x0 83// CHECK: Offset: 340 84// CHECK: Alignment: 0 85// CHECK: RelocationOffset: 0x0 86// CHECK: RelocationCount: 0 87// CHECK: Type: 0x0 88// CHECK: Attributes [ (0x800000) 89// CHECK: PureInstructions (0x800000) 90// CHECK: ] 91// CHECK: Reserved1: 0x0 92// CHECK: Reserved2: 0x0 93// CHECK: } 94// CHECK: Section { 95// CHECK: Index: 1 96// CHECK: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00) 97// CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00) 98// CHECK: Address: 0x0 99// CHECK: Size: 0x0 100// CHECK: Offset: 340 101// CHECK: Alignment: 0 102// CHECK: RelocationOffset: 0x0 103// CHECK: RelocationCount: 0 104// CHECK: Type: 0x0 105// CHECK: Attributes [ (0x0) 106// CHECK: ] 107// CHECK: Reserved1: 0x0 108// CHECK: Reserved2: 0x0 109// CHECK: } 110// CHECK: ] 111// CHECK: Relocations [ 112// CHECK: ] 113// CHECK: Symbols [ 114// CHECK: Symbol { 115// CHECK: Name: sym_ref_def_A (354) 116// CHECK: Type: Section (0xE) 117// CHECK: Section: __text (0x1) 118// CHECK: RefType: UndefinedNonLazy (0x0) 119// CHECK: Flags [ (0x20) 120// CHECK: NoDeadStrip (0x20) 121// CHECK: ] 122// CHECK: Value: 0x0 123// CHECK: } 124// CHECK: Symbol { 125// CHECK: Name: sym_ref_def_C (158) 126// CHECK: Type: Section (0xE) 127// CHECK: Section: __text (0x1) 128// CHECK: RefType: UndefinedNonLazy (0x0) 129// CHECK: Flags [ (0x20) 130// CHECK: NoDeadStrip (0x20) 131// CHECK: ] 132// CHECK: Value: 0x0 133// CHECK: } 134// CHECK: Symbol { 135// CHECK: Name: sym_weak_ref_def_A (368) 136// CHECK: Type: Section (0xE) 137// CHECK: Section: __text (0x1) 138// CHECK: RefType: UndefinedNonLazy (0x0) 139// CHECK: Flags [ (0x40) 140// CHECK: WeakRef (0x40) 141// CHECK: ] 142// CHECK: Value: 0x0 143// CHECK: } 144// CHECK: Symbol { 145// CHECK: Name: sym_weak_ref_def_B (220) 146// CHECK: Type: Section (0xE) 147// CHECK: Section: __text (0x1) 148// CHECK: RefType: UndefinedNonLazy (0x0) 149// CHECK: Flags [ (0x0) 150// CHECK: ] 151// CHECK: Value: 0x0 152// CHECK: } 153// CHECK: Symbol { 154// CHECK: Name: sym_lazy_ref_B (190) 155// CHECK: Type: Section (0xE) 156// CHECK: Section: __data (0x2) 157// CHECK: RefType: UndefinedNonLazy (0x0) 158// CHECK: Flags [ (0x20) 159// CHECK: NoDeadStrip (0x20) 160// CHECK: ] 161// CHECK: Value: 0x0 162// CHECK: } 163// CHECK: Symbol { 164// CHECK: Name: sym_lazy_ref_C (128) 165// CHECK: Type: Section (0xE) 166// CHECK: Section: __data (0x2) 167// CHECK: RefType: UndefinedNonLazy (0x0) 168// CHECK: Flags [ (0x20) 169// CHECK: NoDeadStrip (0x20) 170// CHECK: ] 171// CHECK: Value: 0x0 172// CHECK: } 173// CHECK: Symbol { 174// CHECK: Name: sym_symbol_resolver_A (257) 175// CHECK: Type: Section (0xE) 176// CHECK: Section: __data (0x2) 177// CHECK: RefType: UndefinedNonLazy (0x0) 178// CHECK: Flags [ (0x100) 179// CHECK: ] 180// CHECK: Value: 0x0 181// CHECK: } 182// CHECK: Symbol { 183// CHECK: Name: sym_desc_flags (1) 184// CHECK: Type: Section (0xE) 185// CHECK: Section: __data (0x2) 186// CHECK: RefType: UndefinedNonLazy (0x0) 187// CHECK: Flags [ (0x40) 188// CHECK: WeakRef (0x40) 189// CHECK: ] 190// CHECK: Value: 0x0 191// CHECK: } 192// CHECK: Symbol { 193// CHECK: Name: sym_private_ext_B (172) 194// CHECK: PrivateExtern 195// CHECK: Extern 196// CHECK: Type: Section (0xE) 197// CHECK: Section: __data (0x2) 198// CHECK: RefType: UndefinedNonLazy (0x0) 199// CHECK: Flags [ (0x0) 200// CHECK: ] 201// CHECK: Value: 0x0 202// CHECK: } 203// CHECK: Symbol { 204// CHECK: Name: sym_private_ext_C (110) 205// CHECK: PrivateExtern 206// CHECK: Extern 207// CHECK: Type: Section (0xE) 208// CHECK: Section: __data (0x2) 209// CHECK: RefType: UndefinedNonLazy (0x0) 210// CHECK: Flags [ (0x0) 211// CHECK: ] 212// CHECK: Value: 0x0 213// CHECK: } 214// CHECK: Symbol { 215// CHECK: Name: sym_weak_def_A (339) 216// CHECK: Extern 217// CHECK: Type: Section (0xE) 218// CHECK: Section: __data (0x2) 219// CHECK: RefType: UndefinedNonLazy (0x0) 220// CHECK: Flags [ (0x80) 221// CHECK: WeakDef (0x80) 222// CHECK: ] 223// CHECK: Value: 0x0 224// CHECK: } 225// CHECK: Symbol { 226// CHECK: Name: sym_weak_def_B (205) 227// CHECK: Extern 228// CHECK: Type: Section (0xE) 229// CHECK: Section: __data (0x2) 230// CHECK: RefType: UndefinedNonLazy (0x0) 231// CHECK: Flags [ (0x80) 232// CHECK: WeakDef (0x80) 233// CHECK: ] 234// CHECK: Value: 0x0 235// CHECK: } 236// CHECK: Symbol { 237// CHECK: Name: sym_weak_def_C (143) 238// CHECK: Extern 239// CHECK: Type: Section (0xE) 240// CHECK: Section: __data (0x2) 241// CHECK: RefType: UndefinedNonLazy (0x0) 242// CHECK: Flags [ (0x80) 243// CHECK: WeakDef (0x80) 244// CHECK: ] 245// CHECK: Value: 0x0 246// CHECK: } 247// CHECK: Symbol { 248// CHECK: Name: sym_lazy_ref_A (299) 249// CHECK: Extern 250// CHECK: Type: Undef (0x0) 251// CHECK: Section: (0x0) 252// CHECK: RefType: ReferenceFlagUndefinedLazy (0x1) 253// CHECK: Flags [ (0x20) 254// CHECK: NoDeadStrip (0x20) 255// CHECK: ] 256// CHECK: Value: 0x0 257// CHECK: } 258// CHECK: Symbol { 259// CHECK: Name: sym_lazy_ref_D (81) 260// CHECK: Extern 261// CHECK: Type: Undef (0x0) 262// CHECK: Section: (0x0) 263// CHECK: RefType: UndefinedNonLazy (0x0) 264// CHECK: Flags [ (0x20) 265// CHECK: NoDeadStrip (0x20) 266// CHECK: ] 267// CHECK: Value: 0x0 268// CHECK: } 269// CHECK: Symbol { 270// CHECK: Name: sym_lazy_ref_E (34) 271// CHECK: Extern 272// CHECK: Type: Undef (0x0) 273// CHECK: Section: (0x0) 274// CHECK: RefType: ReferenceFlagUndefinedLazy (0x1) 275// CHECK: Flags [ (0x20) 276// CHECK: NoDeadStrip (0x20) 277// CHECK: ] 278// CHECK: Value: 0x0 279// CHECK: } 280// CHECK: Symbol { 281// CHECK: Name: sym_no_dead_strip_A (279) 282// CHECK: Extern 283// CHECK: Type: Undef (0x0) 284// CHECK: Section: (0x0) 285// CHECK: RefType: UndefinedNonLazy (0x0) 286// CHECK: Flags [ (0x20) 287// CHECK: NoDeadStrip (0x20) 288// CHECK: ] 289// CHECK: Value: 0x0 290// CHECK: } 291// CHECK: Symbol { 292// CHECK: Name: sym_private_ext_A (239) 293// CHECK: PrivateExtern 294// CHECK: Extern 295// CHECK: Type: Undef (0x0) 296// CHECK: Section: (0x0) 297// CHECK: RefType: UndefinedNonLazy (0x0) 298// CHECK: Flags [ (0x0) 299// CHECK: ] 300// CHECK: Value: 0x0 301// CHECK: } 302// CHECK: Symbol { 303// CHECK: Name: sym_private_ext_D (63) 304// CHECK: PrivateExtern 305// CHECK: Extern 306// CHECK: Type: Undef (0x0) 307// CHECK: Section: (0x0) 308// CHECK: RefType: UndefinedNonLazy (0x0) 309// CHECK: Flags [ (0x0) 310// CHECK: ] 311// CHECK: Value: 0x0 312// CHECK: } 313// CHECK: Symbol { 314// CHECK: Name: sym_private_ext_E (16) 315// CHECK: PrivateExtern 316// CHECK: Extern 317// CHECK: Type: Undef (0x0) 318// CHECK: Section: (0x0) 319// CHECK: RefType: UndefinedNonLazy (0x0) 320// CHECK: Flags [ (0x0) 321// CHECK: ] 322// CHECK: Value: 0x0 323// CHECK: } 324// CHECK: Symbol { 325// CHECK: Name: sym_ref_A (314) 326// CHECK: Extern 327// CHECK: Type: Undef (0x0) 328// CHECK: Section: (0x0) 329// CHECK: RefType: ReferenceFlagPrivateUndefinedNonLazy (0x4) 330// CHECK: Flags [ (0x1230) 331// CHECK: NoDeadStrip (0x20) 332// CHECK: ReferencedDynamically (0x10) 333// CHECK: ] 334// CHECK: Value: 0x0 335// CHECK: } 336// CHECK: Symbol { 337// CHECK: Name: sym_ref_def_D (96) 338// CHECK: Extern 339// CHECK: Type: Undef (0x0) 340// CHECK: Section: (0x0) 341// CHECK: RefType: UndefinedNonLazy (0x0) 342// CHECK: Flags [ (0x20) 343// CHECK: NoDeadStrip (0x20) 344// CHECK: ] 345// CHECK: Value: 0x0 346// CHECK: } 347// CHECK: Symbol { 348// CHECK: Name: sym_ref_def_E (49) 349// CHECK: Extern 350// CHECK: Type: Undef (0x0) 351// CHECK: Section: (0x0) 352// CHECK: RefType: UndefinedNonLazy (0x0) 353// CHECK: Flags [ (0x20) 354// CHECK: NoDeadStrip (0x20) 355// CHECK: ] 356// CHECK: Value: 0x0 357// CHECK: } 358// CHECK: Symbol { 359// CHECK: Name: sym_weak_ref_A (324) 360// CHECK: Extern 361// CHECK: Type: Undef (0x0) 362// CHECK: Section: (0x0) 363// CHECK: RefType: UndefinedNonLazy (0x0) 364// CHECK: Flags [ (0x40) 365// CHECK: WeakRef (0x40) 366// CHECK: ] 367// CHECK: Value: 0x0 368// CHECK: } 369// CHECK: ] 370// CHECK: Indirect Symbols { 371// CHECK: Number: 0 372// CHECK: Symbols [ 373// CHECK: ] 374// CHECK: } 375// CHECK: Segment { 376// CHECK: Cmd: LC_SEGMENT 377// CHECK: Name: 378// CHECK: Size: 192 379// CHECK: vmaddr: 0x0 380// CHECK: vmsize: 0x0 381// CHECK: fileoff: 340 382// CHECK: filesize: 0 383// CHECK: maxprot: rwx 384// CHECK: initprot: rwx 385// CHECK: nsects: 2 386// CHECK: flags: 0x0 387// CHECK: } 388// CHECK: Dysymtab { 389// CHECK: ilocalsym: 0 390// CHECK: nlocalsym: 8 391// CHECK: iextdefsym: 8 392// CHECK: nextdefsym: 5 393// CHECK: iundefsym: 13 394// CHECK: nundefsym: 11 395// CHECK: tocoff: 0 396// CHECK: ntoc: 0 397// CHECK: modtaboff: 0 398// CHECK: nmodtab: 0 399// CHECK: extrefsymoff: 0 400// CHECK: nextrefsyms: 0 401// CHECK: indirectsymoff: 0 402// CHECK: nindirectsyms: 0 403// CHECK: extreloff: 0 404// CHECK: nextrel: 0 405// CHECK: locreloff: 0 406// CHECK: nlocrel: 0 407// CHECK: } 408