1# RUN: yaml2obj %s -o %t 2# RUN: llvm-objdump --macho --reloc %t | FileCheck %s --check-prefix=OBJDUMP-VERIFY 3 4# OBJDUMP-VERIFY: Relocation information (__TEXT,__text) 8 entries 5# OBJDUMP-VERIFY-NEXT: address pcrel length extern type scattered symbolnum/value 6# OBJDUMP-VERIFY-NEXT: 00000016 False hi/thm n/a HALFDIF True 0x00000064 7# OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x0000001a half = 0x0046 8# OBJDUMP-VERIFY-NEXT: 00000012 False lo/arm n/a HALFDIF True 0x00000064 9# OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x0000001a half = 0x0000 10# OBJDUMP-VERIFY-NEXT: 0000000a False hi/thm n/a HALFDIF True 0x0000005c 11# OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x0000000e half = 0x004a 12# OBJDUMP-VERIFY-NEXT: 00000006 False lo/arm n/a HALFDIF True 0x0000005c 13# OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x0000000e half = 0x0000 14# OBJDUMP-VERIFY-NEXT: Relocation information (__TEXT,__StaticInit) 13 entries 15# OBJDUMP-VERIFY-NEXT: address pcrel length extern type scattered symbolnum/value 16# OBJDUMP-VERIFY-NEXT: 00000028 True long False T_BR22 False 2 (__TEXT,__StaticInit) 17# OBJDUMP-VERIFY-NEXT: 0000001a False hi/thm n/a HALFDIF True 0x00000064 18# OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x00000042 half = 0x001e 19# OBJDUMP-VERIFY-NEXT: 00000016 False lo/arm n/a HALFDIF True 0x00000064 20# OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x00000042 half = 0x0000 21# OBJDUMP-VERIFY-NEXT: 0000000e False hi/thm n/a HALFDIF True 0x00000054 22# OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x00000036 half = 0x001a 23# OBJDUMP-VERIFY-NEXT: 0000000a False lo/arm n/a HALFDIF True 0x00000054 24# OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x00000036 half = 0x0000 25# OBJDUMP-VERIFY-NEXT: 00000004 False hi/thm n/a HALFDIF True 0x00000058 26# OBJDUMP-VERIFY-NEXT: False hi/thm n/a PAIR True 0x0000002c half = 0x0028 27# OBJDUMP-VERIFY-NEXT: 00000000 False lo/arm n/a HALFDIF True 0x00000058 28# OBJDUMP-VERIFY-NEXT: False lo/arm n/a PAIR True 0x0000002c half = 0x0000 29# OBJDUMP-VERIFY-NEXT: Relocation information (__DATA,__data) 1 entries 30# OBJDUMP-VERIFY-NEXT: address pcrel length extern type scattered symbolnum/value 31# OBJDUMP-VERIFY-NEXT: 00000008 False long False VANILLA False 3 (__DATA,__data) 32# OBJDUMP-VERIFY-NEXT: Relocation information (__DATA,__mod_init_func) 1 entries 33# OBJDUMP-VERIFY-NEXT: address pcrel length extern type scattered symbolnum/value 34# OBJDUMP-VERIFY-NEXT: 00000000 False long False VANILLA False 2 (__TEXT,__StaticInit) 35 36# RUN: obj2yaml %t | FileCheck %s 37# CHECK: Sections: 38# CHECK-NEXT: - sectname: __text 39# CHECK-NEXT: segname: __TEXT 40# CHECK-NEXT: addr: 0x0 41# CHECK-NEXT: size: 36 42# CHECK-NEXT: offset: 0x220 43# CHECK-NEXT: align: 1 44# CHECK-NEXT: reloff: 0x284 45# CHECK-NEXT: nreloc: 8 46# CHECK-NEXT: flags: 0x80000400 47# CHECK-NEXT: reserved1: 0x0 48# CHECK-NEXT: reserved2: 0x0 49# CHECK-NEXT: reserved3: 0x0 50# CHECK-NEXT: content: 51# CHECK-NEXT: relocations: 52# CHECK-NEXT: - address: 0x16 53# CHECK-NEXT: symbolnum: 0 54# CHECK-NEXT: pcrel: false 55# CHECK-NEXT: length: 3 56# CHECK-NEXT: extern: false 57# CHECK-NEXT: type: 9 58# CHECK-NEXT: scattered: true 59# CHECK-NEXT: value: 100 60# CHECK-NEXT: - address: 0x46 61# CHECK-NEXT: symbolnum: 0 62# CHECK-NEXT: pcrel: false 63# CHECK-NEXT: length: 3 64# CHECK-NEXT: extern: false 65# CHECK-NEXT: type: 1 66# CHECK-NEXT: scattered: true 67# CHECK-NEXT: value: 26 68# CHECK-NEXT: - address: 0x12 69# CHECK-NEXT: symbolnum: 0 70# CHECK-NEXT: pcrel: false 71# CHECK-NEXT: length: 2 72# CHECK-NEXT: extern: false 73# CHECK-NEXT: type: 9 74# CHECK-NEXT: scattered: true 75# CHECK-NEXT: value: 100 76# CHECK-NEXT: - address: 0x0 77# CHECK-NEXT: symbolnum: 0 78# CHECK-NEXT: pcrel: false 79# CHECK-NEXT: length: 2 80# CHECK-NEXT: extern: false 81# CHECK-NEXT: type: 1 82# CHECK-NEXT: scattered: true 83# CHECK-NEXT: value: 26 84# CHECK-NEXT: - address: 0xA 85# CHECK-NEXT: symbolnum: 0 86# CHECK-NEXT: pcrel: false 87# CHECK-NEXT: length: 3 88# CHECK-NEXT: extern: false 89# CHECK-NEXT: type: 9 90# CHECK-NEXT: scattered: true 91# CHECK-NEXT: value: 92 92# CHECK-NEXT: - address: 0x4A 93# CHECK-NEXT: symbolnum: 0 94# CHECK-NEXT: pcrel: false 95# CHECK-NEXT: length: 3 96# CHECK-NEXT: extern: false 97# CHECK-NEXT: type: 1 98# CHECK-NEXT: scattered: true 99# CHECK-NEXT: value: 14 100# CHECK-NEXT: - address: 0x6 101# CHECK-NEXT: symbolnum: 0 102# CHECK-NEXT: pcrel: false 103# CHECK-NEXT: length: 2 104# CHECK-NEXT: extern: false 105# CHECK-NEXT: type: 9 106# CHECK-NEXT: scattered: true 107# CHECK-NEXT: value: 92 108# CHECK-NEXT: - address: 0x0 109# CHECK-NEXT: symbolnum: 0 110# CHECK-NEXT: pcrel: false 111# CHECK-NEXT: length: 2 112# CHECK-NEXT: extern: false 113# CHECK-NEXT: type: 1 114# CHECK-NEXT: scattered: true 115# CHECK-NEXT: value: 14 116# CHECK-NEXT: - sectname: __StaticInit 117# CHECK-NEXT: segname: __TEXT 118# CHECK-NEXT: addr: 0x24 119# CHECK-NEXT: size: 46 120# CHECK-NEXT: offset: 0x244 121# CHECK-NEXT: align: 1 122# CHECK-NEXT: reloff: 0x2C4 123# CHECK-NEXT: nreloc: 13 124# CHECK-NEXT: flags: 0x80000400 125# CHECK-NEXT: reserved1: 0x0 126# CHECK-NEXT: reserved2: 0x0 127# CHECK-NEXT: reserved3: 0x0 128# CHECK-NEXT: content: 129# CHECK-NEXT: relocations: 130# CHECK-NEXT: - address: 0x28 131# CHECK-NEXT: symbolnum: 2 132# CHECK-NEXT: pcrel: true 133# CHECK-NEXT: length: 2 134# CHECK-NEXT: extern: false 135# CHECK-NEXT: type: 6 136# CHECK-NEXT: scattered: false 137# CHECK-NEXT: value: 0 138# CHECK-NEXT: - address: 0x1A 139# CHECK-NEXT: symbolnum: 0 140# CHECK-NEXT: pcrel: false 141# CHECK-NEXT: length: 3 142# CHECK-NEXT: extern: false 143# CHECK-NEXT: type: 9 144# CHECK-NEXT: scattered: true 145# CHECK-NEXT: value: 100 146# CHECK-NEXT: - address: 0x1E 147# CHECK-NEXT: symbolnum: 0 148# CHECK-NEXT: pcrel: false 149# CHECK-NEXT: length: 3 150# CHECK-NEXT: extern: false 151# CHECK-NEXT: type: 1 152# CHECK-NEXT: scattered: true 153# CHECK-NEXT: value: 66 154# CHECK-NEXT: - address: 0x16 155# CHECK-NEXT: symbolnum: 0 156# CHECK-NEXT: pcrel: false 157# CHECK-NEXT: length: 2 158# CHECK-NEXT: extern: false 159# CHECK-NEXT: type: 9 160# CHECK-NEXT: scattered: true 161# CHECK-NEXT: value: 100 162# CHECK-NEXT: - address: 0x0 163# CHECK-NEXT: symbolnum: 0 164# CHECK-NEXT: pcrel: false 165# CHECK-NEXT: length: 2 166# CHECK-NEXT: extern: false 167# CHECK-NEXT: type: 1 168# CHECK-NEXT: scattered: true 169# CHECK-NEXT: value: 66 170# CHECK-NEXT: - address: 0xE 171# CHECK-NEXT: symbolnum: 0 172# CHECK-NEXT: pcrel: false 173# CHECK-NEXT: length: 3 174# CHECK-NEXT: extern: false 175# CHECK-NEXT: type: 9 176# CHECK-NEXT: scattered: true 177# CHECK-NEXT: value: 84 178# CHECK-NEXT: - address: 0x1A 179# CHECK-NEXT: symbolnum: 0 180# CHECK-NEXT: pcrel: false 181# CHECK-NEXT: length: 3 182# CHECK-NEXT: extern: false 183# CHECK-NEXT: type: 1 184# CHECK-NEXT: scattered: true 185# CHECK-NEXT: value: 54 186# CHECK-NEXT: - address: 0xA 187# CHECK-NEXT: symbolnum: 0 188# CHECK-NEXT: pcrel: false 189# CHECK-NEXT: length: 2 190# CHECK-NEXT: extern: false 191# CHECK-NEXT: type: 9 192# CHECK-NEXT: scattered: true 193# CHECK-NEXT: value: 84 194# CHECK-NEXT: - address: 0x0 195# CHECK-NEXT: symbolnum: 0 196# CHECK-NEXT: pcrel: false 197# CHECK-NEXT: length: 2 198# CHECK-NEXT: extern: false 199# CHECK-NEXT: type: 1 200# CHECK-NEXT: scattered: true 201# CHECK-NEXT: value: 54 202# CHECK-NEXT: - address: 0x4 203# CHECK-NEXT: symbolnum: 0 204# CHECK-NEXT: pcrel: false 205# CHECK-NEXT: length: 3 206# CHECK-NEXT: extern: false 207# CHECK-NEXT: type: 9 208# CHECK-NEXT: scattered: true 209# CHECK-NEXT: value: 88 210# CHECK-NEXT: - address: 0x28 211# CHECK-NEXT: symbolnum: 0 212# CHECK-NEXT: pcrel: false 213# CHECK-NEXT: length: 3 214# CHECK-NEXT: extern: false 215# CHECK-NEXT: type: 1 216# CHECK-NEXT: scattered: true 217# CHECK-NEXT: value: 44 218# CHECK-NEXT: - address: 0x0 219# CHECK-NEXT: symbolnum: 0 220# CHECK-NEXT: pcrel: false 221# CHECK-NEXT: length: 2 222# CHECK-NEXT: extern: false 223# CHECK-NEXT: type: 9 224# CHECK-NEXT: scattered: true 225# CHECK-NEXT: value: 88 226# CHECK-NEXT: - address: 0x0 227# CHECK-NEXT: symbolnum: 0 228# CHECK-NEXT: pcrel: false 229# CHECK-NEXT: length: 2 230# CHECK-NEXT: extern: false 231# CHECK-NEXT: type: 1 232# CHECK-NEXT: scattered: true 233# CHECK-NEXT: value: 44 234# CHECK-NEXT: - sectname: __data 235# CHECK-NEXT: segname: __DATA 236# CHECK-NEXT: addr: 0x54 237# CHECK-NEXT: size: 12 238# CHECK-NEXT: offset: 0x274 239# CHECK-NEXT: align: 2 240# CHECK-NEXT: reloff: 0x32C 241# CHECK-NEXT: nreloc: 1 242# CHECK-NEXT: flags: 0x0 243# CHECK-NEXT: reserved1: 0x0 244# CHECK-NEXT: reserved2: 0x0 245# CHECK-NEXT: reserved3: 0x0 246# CHECK-NEXT: content: 247# CHECK-NEXT: relocations: 248# CHECK-NEXT: - address: 0x8 249# CHECK-NEXT: symbolnum: 3 250# CHECK-NEXT: pcrel: false 251# CHECK-NEXT: length: 2 252# CHECK-NEXT: extern: false 253# CHECK-NEXT: type: 0 254# CHECK-NEXT: scattered: false 255# CHECK-NEXT: value: 0 256# CHECK-NEXT: - sectname: __common 257# CHECK-NEXT: segname: __DATA 258# CHECK-NEXT: addr: 0x64 259# CHECK-NEXT: size: 4 260# CHECK-NEXT: offset: 0x0 261# CHECK-NEXT: align: 2 262# CHECK-NEXT: reloff: 0x0 263# CHECK-NEXT: nreloc: 0 264# CHECK-NEXT: flags: 0x1 265# CHECK-NEXT: reserved1: 0x0 266# CHECK-NEXT: reserved2: 0x0 267# CHECK-NEXT: reserved3: 0x0 268# CHECK-NEXT: - sectname: __mod_init_func 269# CHECK-NEXT: segname: __DATA 270# CHECK-NEXT: addr: 0x60 271# CHECK-NEXT: size: 4 272# CHECK-NEXT: offset: 0x280 273# CHECK-NEXT: align: 2 274# CHECK-NEXT: reloff: 0x334 275# CHECK-NEXT: nreloc: 1 276# CHECK-NEXT: flags: 0x9 277# CHECK-NEXT: reserved1: 0x0 278# CHECK-NEXT: reserved2: 0x0 279# CHECK-NEXT: reserved3: 0x0 280# CHECK-NEXT: content: '48000000' 281# CHECK-NEXT: relocations: 282# CHECK-NEXT: - address: 0x0 283# CHECK-NEXT: symbolnum: 2 284# CHECK-NEXT: pcrel: false 285# CHECK-NEXT: length: 2 286# CHECK-NEXT: extern: false 287# CHECK-NEXT: type: 0 288# CHECK-NEXT: scattered: false 289# CHECK-NEXT: value: 0 290 291--- !mach-o 292FileHeader: 293 magic: 0xFEEDFACE 294 cputype: 0x0000000C 295 cpusubtype: 0x00000009 296 filetype: 0x00000001 297 ncmds: 4 298 sizeofcmds: 516 299 flags: 0x00002000 300LoadCommands: 301 - cmd: LC_SEGMENT 302 cmdsize: 396 303 segname: '' 304 vmaddr: 0 305 vmsize: 104 306 fileoff: 544 307 filesize: 100 308 maxprot: 7 309 initprot: 7 310 nsects: 5 311 flags: 0 312 Sections: 313 - sectname: __text 314 segname: __TEXT 315 addr: 0x0000000000000000 316 size: 36 317 offset: 0x00000220 318 align: 1 319 reloff: 0x00000284 320 nreloc: 8 321 flags: 0x80000400 322 reserved1: 0x00000000 323 reserved2: 0x00000000 324 reserved3: 0x00000000 325 content: 81B00020009040F24A00C0F200007844006840F24601C0F2000179440968084401B07047 326 relocations: 327 - address: 0x00000016 328 symbolnum: 0 329 pcrel: false 330 length: 3 331 extern: false 332 type: 9 333 scattered: true 334 value: 100 335 - address: 0x00000046 336 symbolnum: 0 337 pcrel: false 338 length: 3 339 extern: false 340 type: 1 341 scattered: true 342 value: 26 343 - address: 0x00000012 344 symbolnum: 0 345 pcrel: false 346 length: 2 347 extern: false 348 type: 9 349 scattered: true 350 value: 100 351 - address: 0x00000000 352 symbolnum: 0 353 pcrel: false 354 length: 2 355 extern: false 356 type: 1 357 scattered: true 358 value: 26 359 - address: 0x0000000A 360 symbolnum: 0 361 pcrel: false 362 length: 3 363 extern: false 364 type: 9 365 scattered: true 366 value: 92 367 - address: 0x0000004A 368 symbolnum: 0 369 pcrel: false 370 length: 3 371 extern: false 372 type: 1 373 scattered: true 374 value: 14 375 - address: 0x00000006 376 symbolnum: 0 377 pcrel: false 378 length: 2 379 extern: false 380 type: 9 381 scattered: true 382 value: 92 383 - address: 0x00000000 384 symbolnum: 0 385 pcrel: false 386 length: 2 387 extern: false 388 type: 1 389 scattered: true 390 value: 14 391 - sectname: __StaticInit 392 segname: __TEXT 393 addr: 0x0000000000000024 394 size: 46 395 offset: 0x00000244 396 align: 1 397 reloff: 0x000002C4 398 nreloc: 13 399 flags: 0x80000400 400 reserved1: 0x00000000 401 reserved2: 0x00000000 402 reserved3: 0x00000000 403 content: 40F22800C0F20000784440F21A01C0F200017944081A40F21E01C0F2000179440860704780B56F46FFF7EAFF80BD 404 relocations: 405 - address: 0x00000028 406 symbolnum: 2 407 pcrel: true 408 length: 2 409 extern: false 410 type: 6 411 scattered: false 412 value: 0 413 - address: 0x0000001A 414 symbolnum: 0 415 pcrel: false 416 length: 3 417 extern: false 418 type: 9 419 scattered: true 420 value: 100 421 - address: 0x0000001E 422 symbolnum: 0 423 pcrel: false 424 length: 3 425 extern: false 426 type: 1 427 scattered: true 428 value: 66 429 - address: 0x00000016 430 symbolnum: 0 431 pcrel: false 432 length: 2 433 extern: false 434 type: 9 435 scattered: true 436 value: 100 437 - address: 0x00000000 438 symbolnum: 0 439 pcrel: false 440 length: 2 441 extern: false 442 type: 1 443 scattered: true 444 value: 66 445 - address: 0x0000000E 446 symbolnum: 0 447 pcrel: false 448 length: 3 449 extern: false 450 type: 9 451 scattered: true 452 value: 84 453 - address: 0x0000001A 454 symbolnum: 0 455 pcrel: false 456 length: 3 457 extern: false 458 type: 1 459 scattered: true 460 value: 54 461 - address: 0x0000000A 462 symbolnum: 0 463 pcrel: false 464 length: 2 465 extern: false 466 type: 9 467 scattered: true 468 value: 84 469 - address: 0x00000000 470 symbolnum: 0 471 pcrel: false 472 length: 2 473 extern: false 474 type: 1 475 scattered: true 476 value: 54 477 - address: 0x00000004 478 symbolnum: 0 479 pcrel: false 480 length: 3 481 extern: false 482 type: 9 483 scattered: true 484 value: 88 485 - address: 0x00000028 486 symbolnum: 0 487 pcrel: false 488 length: 3 489 extern: false 490 type: 1 491 scattered: true 492 value: 44 493 - address: 0x00000000 494 symbolnum: 0 495 pcrel: false 496 length: 2 497 extern: false 498 type: 9 499 scattered: true 500 value: 88 501 - address: 0x00000000 502 symbolnum: 0 503 pcrel: false 504 length: 2 505 extern: false 506 type: 1 507 scattered: true 508 value: 44 509 - sectname: __data 510 segname: __DATA 511 addr: 0x0000000000000054 512 size: 12 513 offset: 0x00000274 514 align: 2 515 reloff: 0x0000032C 516 nreloc: 1 517 flags: 0x00000000 518 reserved1: 0x00000000 519 reserved2: 0x00000000 520 reserved3: 0x00000000 521 content: '010000000200000054000000' 522 relocations: 523 - address: 0x00000008 524 symbolnum: 3 525 pcrel: false 526 length: 2 527 extern: false 528 type: 0 529 scattered: false 530 value: 0 531 - sectname: __common 532 segname: __DATA 533 addr: 0x0000000000000064 534 size: 4 535 offset: 0x00000000 536 align: 2 537 reloff: 0x00000000 538 nreloc: 0 539 flags: 0x00000001 540 reserved1: 0x00000000 541 reserved2: 0x00000000 542 reserved3: 0x00000000 543 - sectname: __mod_init_func 544 segname: __DATA 545 addr: 0x0000000000000060 546 size: 4 547 offset: 0x00000280 548 align: 2 549 reloff: 0x00000334 550 nreloc: 1 551 flags: 0x00000009 552 reserved1: 0x00000000 553 reserved2: 0x00000000 554 reserved3: 0x00000000 555 content: '48000000' 556 relocations: 557 - address: 0x00000000 558 symbolnum: 2 559 pcrel: false 560 length: 2 561 extern: false 562 type: 0 563 scattered: false 564 value: 0 565 - cmd: LC_VERSION_MIN_IPHONEOS 566 cmdsize: 16 567 version: 589824 568 sdk: 0 569 - cmd: LC_SYMTAB 570 cmdsize: 24 571 symoff: 828 572 nsyms: 7 573 stroff: 912 574 strsize: 68 575 - cmd: LC_DYSYMTAB 576 cmdsize: 80 577 ilocalsym: 0 578 nlocalsym: 2 579 iextdefsym: 2 580 nextdefsym: 5 581 iundefsym: 7 582 nundefsym: 0 583 tocoff: 0 584 ntoc: 0 585 modtaboff: 0 586 nmodtab: 0 587 extrefsymoff: 0 588 nextrefsyms: 0 589 indirectsymoff: 0 590 nindirectsyms: 0 591 extreloff: 0 592 nextrel: 0 593 locreloff: 0 594 nlocrel: 0 595LinkEditData: 596 NameList: 597 - n_strx: 13 598 n_type: 0x0E 599 n_sect: 2 600 n_desc: 8 601 n_value: 36 602 - n_strx: 36 603 n_type: 0x0E 604 n_sect: 2 605 n_desc: 8 606 n_value: 72 607 - n_strx: 61 608 n_type: 0x0F 609 n_sect: 1 610 n_desc: 8 611 n_value: 0 612 - n_strx: 10 613 n_type: 0x0F 614 n_sect: 4 615 n_desc: 0 616 n_value: 100 617 - n_strx: 7 618 n_type: 0x0F 619 n_sect: 3 620 n_desc: 0 621 n_value: 84 622 - n_strx: 4 623 n_type: 0x0F 624 n_sect: 3 625 n_desc: 0 626 n_value: 88 627 - n_strx: 1 628 n_type: 0x0F 629 n_sect: 3 630 n_desc: 0 631 n_value: 92 632 StringTable: 633 - '' 634 - _z 635 - _y 636 - _x 637 - _w 638 - ___cxx_global_var_init 639 - __GLOBAL__sub_I_main.cpp 640 - _main 641 - '' 642... 643