1# How to generate this file: 2# 1. First take a swift file and run xcrun swiftc -g -v file.swift 3# secondfile.swift, make sure the two swift files are in a short path like /tmp/ 4 5# 2. Now you can see what the driver does, generate the object files in the 6# tmp directory 7 8# 3. Run obj2yaml on object file to create a yaml file 9 10# 4. I ran delta to reduce this file. 11 12--- !mach-o 13FileHeader: 14 magic: 0xFEEDFACF 15 cputype: 0x1000007 16 cpusubtype: 0x3 17 filetype: 0x1 18 ncmds: 8 19 sizeofcmds: 3120 20 flags: 0x2000 21 reserved: 0x0 22LoadCommands: 23 - cmd: LC_SEGMENT_64 24 cmdsize: 2872 25 segname: '' 26 vmaddr: 0 27 vmsize: 21352 28 fileoff: 2832 29 filesize: 20967 30 maxprot: 7 31 initprot: 7 32 nsects: 33 33 flags: 0 34 Sections: 35 - sectname: __text 36 segname: __TEXT 37 addr: 0x0 38 size: 4571 39 offset: 0xC50 40 align: 4 41 reloff: 0x5CF8 42 nreloc: 74 43 flags: 0x80000400 44 reserved1: 0x0 45 reserved2: 0x0 46 relocations: 47 - address: 0x11A1 48 symbolnum: 142 49 pcrel: true 50 length: 2 51 extern: true 52 type: 1 53 scattered: false 54 value: 0 55 - sectname: __swift5_typeref 56 segname: __TEXT 57 addr: 0x11DC 58 size: 117 59 offset: 0x1E2C 60 align: 1 61 reloff: 0x5F48 62 nreloc: 22 63 flags: 0x10000000 64 reserved1: 0x0 65 reserved2: 0x0 66 content: 7800423000005369000001FFFFFFFF002473346D61696E31304D7950726F746F636F6C50000001FFFFFFFF0001FFFFFFFF0001FFFFFFFF0001FFFFFFFF0035496E6E657201F9FFFFFF517A0001FFFFFFFF797847000001FFFFFFFF797847000001FFFFFFFF0001FFFFFFFF0001FFFFFFFF79784700 67 relocations: 68 - address: 0x6D 69 symbolnum: 163 70 pcrel: false 71 length: 2 72 extern: true 73 type: 0 74 scattered: false 75 value: 0 76 - sectname: __swift5_capture 77 segname: __TEXT 78 addr: 0x1254 79 size: 24 80 offset: 0x1EA4 81 align: 2 82 reloff: 0x5FF8 83 nreloc: 6 84 flags: 0x10000000 85 reserved1: 0x0 86 reserved2: 0x0 87 content: 010000000100000002000000F4FFFFFFF0FFFFFFECFFFFFF 88 relocations: 89 - address: 0x14 90 symbolnum: 29 91 pcrel: false 92 length: 3 93 extern: true 94 type: 0 95 scattered: false 96 value: 0 97 - sectname: __swift5_reflstr 98 segname: __TEXT 99 addr: 0x17D8 100 size: 37 101 offset: 0x2428 102 align: 0 103 reloff: 0x0 104 nreloc: 0 105 flags: 0x10000000 106 reserved1: 0x0 107 reserved2: 0x0 108 content: 496E6E65720069006D73006D6500696E6E6572004300490074006D6773006D676500474300 109 - sectname: __swift5_assocty 110 segname: __TEXT 111 addr: 0x1800 112 size: 24 113 offset: 0x2450 114 align: 2 115 reloff: 0x6530 116 nreloc: 8 117 flags: 0x10000000 118 reserved1: 0x0 119 reserved2: 0x0 120 content: 00000000FCFFFFFF0100000008000000F0FFFFFFECFFFFFF 121 relocations: 122 - address: 0x14 123 symbolnum: 31 124 pcrel: false 125 length: 2 126 extern: true 127 type: 5 128 scattered: false 129 value: 0 130 - sectname: __swift5_fieldmd 131 segname: __TEXT 132 addr: 0x1818 133 size: 260 134 offset: 0x2468 135 align: 2 136 reloff: 0x6570 137 nreloc: 60 138 flags: 0x10000000 139 reserved1: 0x0 140 reserved2: 0x0 141 content: 000000000000000004000C0000000000000000000000000001000C000300000000000000ECFFFFFFE8FFFFFF00000000E0FFFFFFDCFFFFFF00000000D4FFFFFFD0FFFFFF000000000000000000000C000100000002000000ECFFFFFFE8FFFFFF000000000000000000000C0000000000000000000000000003000C000200000000000000ECFFFFFFE8FFFFFF00000000E0FFFFFFDCFFFFFF000000000000000001000C000400000000000000ECFFFFFFE8FFFFFF00000000E0FFFFFFDCFFFFFF00000000D4FFFFFFD0FFFFFF00000000C8FFFFFFC4FFFFFF000000000000000000000C0000000000000000000000000002000C000100000000000000ECFFFFFFE8FFFFFF 142 relocations: 143 - address: 0x100 144 symbolnum: 71 145 pcrel: false 146 length: 2 147 extern: true 148 type: 0 149 scattered: false 150 value: 0 151 - sectname: __swift5_builtin 152 segname: __TEXT 153 addr: 0x1AC8 154 size: 20 155 offset: 0x2718 156 align: 2 157 reloff: 0x67F8 158 nreloc: 2 159 flags: 0x10000000 160 reserved1: 0x0 161 reserved2: 0x0 162 content: 00000000090000000800010010000000FE000000 163 relocations: 164 - address: 0x0 165 symbolnum: 52 166 pcrel: false 167 length: 2 168 extern: true 169 type: 5 170 scattered: false 171 value: 0 172 - sectname: __swift5_proto 173 segname: __TEXT 174 addr: 0x1AEC 175 size: 10 176 offset: 0x273C 177 align: 2 178 reloff: 0x0 179 nreloc: 0 180 flags: 0x10000000 181 reserved1: 0x0 182 reserved2: 0x0 183 content: 41424344454647484950 184 - sectname: __swift5_protos 185 segname: __TEXT 186 addr: 0x1AF8 187 size: 10 188 offset: 0x2760 189 align: 2 190 reloff: 0x0 191 nreloc: 0 192 flags: 0x10000000 193 reserved1: 0x0 194 reserved2: 0x0 195 content: 51525354555657585960 196 - sectname: __swift5_acfuncs 197 segname: __TEXT 198 addr: 0x1B04 199 size: 10 200 offset: 0x2784 201 align: 2 202 reloff: 0x0 203 nreloc: 0 204 flags: 0x10000000 205 reserved1: 0x0 206 reserved2: 0x0 207 content: 61626364656667686970 208 - sectname: __swift5_mpenum 209 segname: __TEXT 210 addr: 0x1B10 211 size: 10 212 offset: 0x27A8 213 align: 2 214 reloff: 0x0 215 nreloc: 0 216 flags: 0x10000000 217 reserved1: 0x0 218 reserved2: 0x0 219 content: 71727374757677787980 220 - sectname: __bss 221 segname: __DATA 222 addr: 0x3372 223 size: 2084 224 offset: 0x5220 225 align: 3 226 reloff: 0x0 227 nreloc: 0 228 flags: 0x6800000B 229 reserved1: 0x0 230 reserved2: 0x0 231 relocations: 232 - address: 0x56 233 symbolnum: 1 234 pcrel: false 235 length: 3 236 extern: false 237 type: 0 238 scattered: false 239 value: 0 240 - cmd: LC_BUILD_VERSION 241 cmdsize: 24 242 platform: 1 243 minos: 786432 244 sdk: 786688 245 ntools: 0 246 - cmd: LC_SYMTAB 247 cmdsize: 24 248 symoff: 27888 249 nsyms: 185 250 stroff: 30848 251 strsize: 5056 252 - cmd: LC_DYSYMTAB 253 cmdsize: 80 254 ilocalsym: 0 255 nlocalsym: 79 256 iextdefsym: 79 257 nextdefsym: 87 258 iundefsym: 166 259 nundefsym: 19 260 tocoff: 0 261 ntoc: 0 262 modtaboff: 0 263 nmodtab: 0 264 extrefsymoff: 0 265 nextrefsyms: 0 266 indirectsymoff: 0 267 nindirectsyms: 0 268 extreloff: 0 269 nextrel: 0 270 locreloff: 0 271 nlocrel: 0 272 - cmd: LC_LINKER_OPTION 273 cmdsize: 40 274 count: 1 275 PayloadBytes: [ 0x2D, 0x6C, 0x73, 0x77, 0x69, 0x66, 0x74, 0x53, 276 0x0, 0x0, 0x0, 0x0 ] 277 - cmd: LC_LINKER_OPTION 278 cmdsize: 24 279 count: 1 280 PayloadBytes: [ 0x2D, 0x6C, 0x73, 0x77, 0x69, 0x66, 0x74, 0x43, 281 0x6F, 0x72, 0x65, 0x0 ] 282 - cmd: LC_LINKER_OPTION 283 cmdsize: 32 284 count: 1 285 PayloadBytes: [ 0x2D, 0x6C, 0x73, 0x77, 0x69, 0x66, 0x74, 0x5F, 286 0x6E, 0x63, 0x79, 0x0 ] 287 - cmd: LC_LINKER_OPTION 288 cmdsize: 24 289 count: 1 290 PayloadBytes: [ 0x2D, 0x6C, 0x6F, 0x62, 0x6A, 0x63, 0x0, 0x0, 0x0, 291 0x0, 0x0, 0x0 ] 292LinkEditData: 293 NameList: 294 - n_strx: 5014 295 n_type: 0xE 296 n_sect: 1 297 n_desc: 0 298 n_value: 5600 299 StringTable: 300 - '' 301 - l_objectdestroy 302 - '_$s4main6MyEnumOWOy' 303 - '_$s4main6MyEnumOwxx' 304 - _symbolic x 305 - '_$s4main6MyEnumOwst' 306 - '_$s4main13MyGenericEnumOwst' 307 - '_$s4main6MyEnumOwet' 308 - '_$s4main13MyGenericEnumOwet' 309 - '_OBJC_CLASS_$__TtCs12_SwiftObject' 310 - '_OBJC_METACLASS_$__TtCs12_SwiftObject' 311 - _swift_deallocObject 312 - _swift_allocObject 313 - '_$s4main11ConformanceV5innerSivs' 314 - _swift_getAssociatedTypeWitness 315 - __IVARS__TtC4main7MyClass 316 - __DATA__TtC4main7MyClass 317 - __METACLASS_DATA__TtC4main7MyClass 318 - __IVARS__TtC4main14MyGenericClass 319 - l_protocols 320 - _objc_classes 321 - l_protocol_conformances 322 - l__swift5_reflection_descriptor 323 - l_coro.devirt.trigger 324 - '_$s4main14MyGenericClassCMr' 325 - '_$s4main7MyClassC1i2ms2meACSi_AA0B6StructVAA0B4EnumOtcfCTq' 326 - '_$s4main14MyGenericClassC1t1i3mgs3mgeACyxGx_5InnerQzAA0bC6StructVyxGAA0bC4EnumOyxGtcfCTq' 327 - '_$s4main6MyEnumOwup' 328 - '_$s4main13MyGenericEnumOwup' 329 - '_$s4main6MyEnumOwcp' 330 - '_$s4main10MyProtocolMp' 331 - ___swift_reflection_version 332 - ____chkstk_darwin 333 - _swift_retain 334 - '_$s4main8MyStructVMn' 335 - '_$s4main15MyGenericStructVMn' 336 - '_$s4main11ConformanceVMn' 337 - '_$s4main6MyEnumOMn' 338 - '_$s4main13MyGenericEnumOMn' 339 - '_$s4main7MyClassCMn' 340 - '_$s4main14MyGenericClassCMn' 341 - '_$s4main7MyClassCMm' 342 - '_$s5Inner4main10MyProtocolPTl' 343 - '_$s4main6MyEnumOwui' 344 - '_$s4main13MyGenericEnumOwui' 345 - '_$s4main11ConformanceV5innerSivpfi' 346 - _symbolic Si 347 - '_$s4main15MyGenericStructVMi' 348 - '_$s4main13MyGenericEnumOMi' 349 - '_$s4main14MyGenericClassCMi' 350 - l_llvm.swift_module_hash 351 - '_$s4main13MyGenericEnumOyxGAA0B8ProtocolRzlWOh' 352 - '_$s4main6MyEnumOWOh' 353 - '_$s4main14MyGenericClassC1i5InnerQzvg' 354 - '_$s4main14MyGenericClassC1txvg' 355 - '_$s4main11ConformanceV5innerSivg' 356 - '_$s4main7MyClassC1iSivg' 357 - '_$s4main7MyClassC2msAA0B6StructVvg' 358 - '_$s4main7MyClassC2meAA0B4EnumOvg' 359 - '_$s4main14MyGenericClassC3mgsAA0bC6StructVyxGvg' 360 - '_$s4main14MyGenericClassC3mgeAA0bC4EnumOyxGvg' 361 - '_$s4main6MyEnumOwug' 362 - '_$s4main13MyGenericEnumOwug' 363 - ___swift_initWithCopy_strong 364 - ___swift_assignWithCopy_strong 365 - ___swift_destroy_strong 366 - ___swift_assignWithTake_strong 367 - _objc_opt_self 368 - '_$s4main8MyStructVMf' 369 - '_$s4main11ConformanceVMf' 370 - '_$s4main6MyEnumOMf' 371 - '_$s4main7MyClassCMf' 372 - _swift_checkMetadataState 373 - _swift_release 374 - l_type_metadata_table 375 - __objc_empty_cache 376 - _swift_deallocClassInstance 377 - ___chkstk_darwin_llvm_probe 378 - '_$s4main6MyEnumOWOe' 379 - '_$s4main7MyClassC1iSivpWvd' 380 - '_$s4main7MyClassC2msAA0B6StructVvpWvd' 381 - '_$s4main7MyClassC2meAA0B4EnumOvpWvd' 382 - '_$s4main14MyGenericClassC3mgsAA0bC6StructVyxGvpWvd' 383 - '_$s4main7MyClassCfd' 384 - '_$s4main14MyGenericClassCfd' 385 - '_$s4main7MyClassC1i2ms2meACSi_AA0B6StructVAA0B4EnumOtcfc' 386 - '_$s4main14MyGenericClassC1t1i3mgs3mgeACyxGx_5InnerQzAA0bC6StructVyxGAA0bC4EnumOyxGtcfc' 387 - '_$s4main11ConformanceVAA10MyProtocolAAMc' 388 - '_$s4main6MyEnumOwta' 389 - l_metadata 390 - _swift_allocateGenericClassMetadata 391 - _swift_allocateGenericValueMetadata 392 - _swift_getGenericMetadata 393 - ___swift_instantiateGenericMetadata 394 - '_$s4main6MyEnumOwca' 395 - '_$s4main8MyStructVMa' 396 - '_$s4main15MyGenericStructVMa' 397 - '_$s4main11ConformanceVMa' 398 - '_$s4main6MyEnumOMa' 399 - '_$s4main13MyGenericEnumOMa' 400 - '_$s4main7MyClassCMa' 401 - '_$s4main14MyGenericClassCMa' 402 - '_$s4main16makeSomeClosures1tyycx_tAA10MyProtocolRzlFyycfU_' 403 - '_$s4main11ConformanceV5innerACSi_tcfcfA_' 404 - '_$s4main11ConformanceVAA10MyProtocolA2aDP5inner5InnerQzvgTW' 405 - _symbolic _____ 4main8MyStructV 406 - _symbolic _____ 4main15MyGenericStructV 407 - _symbolic _____yxG 4main15MyGenericStructV 408 - _symbolic _____ 4main11ConformanceV 409 - '_$sytWV' 410 - '_$sBoWV' 411 - '_$sBi64_WV' 412 - '_$s4main6MyEnumOWV' 413 - '_$s4main13MyGenericEnumOWV' 414 - '_$s4main11ConformanceV5innerSivpMV' 415 - '_symbolic $s4main10MyProtocolP' 416 - _symbolic 5Inner_____Qz 4main10MyProtocolP 417 - '_$s4main11ConformanceVAA10MyProtocolAAWP' 418 - '_$s4main15MyGenericStructVMP' 419 - '_$s4main13MyGenericEnumOMP' 420 - '_$s4main14MyGenericClassCMP' 421 - '_$s4main6MyEnumOwCP' 422 - _symbolic _____ 4main6MyEnumO 423 - _symbolic _____ 4main13MyGenericEnumO 424 - _symbolic _____yxG 4main13MyGenericEnumO 425 - '_$s4main8MyStructVN' 426 - '_$s4main11ConformanceVN' 427 - '_$s4main6MyEnumON' 428 - '_$s4main7MyClassCN' 429 - '_$s4main11ConformanceV5innerSivM' 430 - '_$s4mainMXM' 431 - '_$s4main10MyProtocolTL' 432 - '_$s4main15MyGenericStructVMI' 433 - '_$s4main13MyGenericEnumOMI' 434 - '_$s4main14MyGenericClassCMI' 435 - '_$s4main16makeSomeClosures1tyycx_tAA10MyProtocolRzlF' 436 - '_$s4main10MyProtocol_pMF' 437 - '_$s4main8MyStructVMF' 438 - '_$s4main15MyGenericStructVMF' 439 - '_$s4main11ConformanceVMF' 440 - '_$s4main6MyEnumOMF' 441 - '_$s4main13MyGenericEnumOMF' 442 - '_$s4main7MyClassCMF' 443 - '_$s4main14MyGenericClassCMF' 444 - '_$s4main7MyClassCfD' 445 - '_$s4main14MyGenericClassCfD' 446 - _symbolic _____ 4main7MyClassC 447 - _symbolic _____ 4main14MyGenericClassC 448 - _symbolic _____yxG 4main14MyGenericClassC 449 - '_$s4main15MyGenericStructVACyxGycfC' 450 - '_$s4main8MyStructVACycfC' 451 - '_$s4main11ConformanceVACycfC' 452 - '_$s4main11ConformanceV5innerACSi_tcfC' 453 - '_$s4main7MyClassC1i2ms2meACSi_AA0B6StructVAA0B4EnumOtcfC' 454 - '_$s4main14MyGenericClassC1t1i3mgs3mgeACyxGx_5InnerQzAA0bC6StructVyxGAA0bC4EnumOyxGtcfC' 455 - '_$s4main6MyEnumOMB' 456 - '_$s4main16makeSomeClosures1tyycx_tAA10MyProtocolRzlFyycfU_TA' 457 - '_$s4main11ConformanceVAA10MyProtocolAAMA' 458 - l___unnamed_29 459 - l___unnamed_19 460 - ___swift_memcpy9_8 461 - ___swift_memcpy8_8 462 - l___unnamed_28 463 - l___unnamed_18 464 - l___unnamed_27 465 - l___unnamed_17 466 - l___unnamed_26 467 - l___unnamed_16 468 - l___unnamed_25 469 - l___unnamed_15 470 - l___unnamed_4 471 - l___unnamed_24 472 - l___unnamed_14 473 - l___unnamed_3 474 - ___unnamed_23 475 - l___unnamed_13 476 - _swift_initClassMetadata2 477 - l___unnamed_2 478 - l___unnamed_12 479 - l___unnamed_1 480 - l___unnamed_11 481 - _symbolic B0 482 - l___unnamed_30 483 - l___unnamed_10 484 - '_$s4main11ConformanceV5innerSivM.resume.0' 485