1 # RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s -o %t | FileCheck %s
2 # RUN: lld -flavor darwin -arch armv7 -r -print_atoms %t -o %t2 | FileCheck %s
4 # Test parsing of armv7 relocations.
11 flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
16 attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
18 address: 0x0000000000000000
19 content: [ 0x00, 0xF0, 0x4E, 0xF8, 0x00, 0xF0, 0x4E, 0xF8,
20 0xFF, 0xF7, 0xFA, 0xFF, 0xFF, 0xF7, 0xFA, 0xFF,
21 0xFF, 0xF7, 0xF6, 0xBF, 0x40, 0xF2, 0x72, 0x01,
22 0xC0, 0xF2, 0x00, 0x01, 0x40, 0xF2, 0x7A, 0x02,
23 0xC0, 0xF2, 0x00, 0x02, 0x40, 0xF2, 0x29, 0x01,
24 0xC0, 0xF2, 0x00, 0x01, 0x79, 0x44, 0x40, 0xF2,
25 0xA0, 0x03, 0xC0, 0xF2, 0x00, 0x03, 0x40, 0xF2,
26 0xA8, 0x04, 0xC0, 0xF2, 0x00, 0x04, 0x40, 0xF2,
27 0x57, 0x03, 0xC0, 0xF2, 0x00, 0x03, 0x40, 0xF2,
28 0x00, 0x05, 0xC0, 0xF2, 0x00, 0x05, 0x40, 0xF2,
29 0x08, 0x06, 0xC0, 0xF2, 0x00, 0x06, 0xC0, 0x46,
30 0x10, 0x00, 0x00, 0xEB, 0x10, 0x00, 0x00, 0xEB,
31 0xE6, 0xFF, 0xFF, 0xEB, 0xE6, 0xFF, 0xFF, 0xEB,
32 0xE4, 0xFF, 0xFF, 0xEA, 0x20, 0x10, 0x00, 0xE3,
33 0x00, 0x10, 0x40, 0xE3, 0x28, 0x20, 0x00, 0xE3,
34 0x00, 0x20, 0x40, 0xE3, 0x0F, 0x10, 0x81, 0xE0,
35 0xA0, 0x30, 0x00, 0xE3, 0x00, 0x30, 0x40, 0xE3,
36 0xA8, 0x40, 0x00, 0xE3, 0x00, 0x40, 0x40, 0xE3,
37 0x00, 0x50, 0x00, 0xE3, 0x00, 0x50, 0x40, 0xE3,
38 0x08, 0x60, 0x00, 0xE3, 0x00, 0x60, 0x40, 0xE3 ]
138 type: ARM_RELOC_HALF_SECTDIFF
150 type: ARM_RELOC_HALF_SECTDIFF
162 type: ARM_RELOC_HALF_SECTDIFF
174 type: ARM_RELOC_HALF_SECTDIFF
336 type: ARM_RELOC_HALF_SECTDIFF
348 type: ARM_RELOC_HALF_SECTDIFF
360 type: ARM_RELOC_HALF_SECTDIFF
372 type: ARM_RELOC_HALF_SECTDIFF
384 type: ARM_RELOC_HALF_SECTDIFF
396 type: ARM_RELOC_HALF_SECTDIFF
407 type: ARM_THUMB_RELOC_BR22
413 type: ARM_THUMB_RELOC_BR22
419 type: ARM_THUMB_RELOC_BR22
426 type: ARM_THUMB_RELOC_BR22
431 type: ARM_THUMB_RELOC_BR22
440 address: 0x00000000000000A0
441 content: [ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
442 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
443 0x04, 0x00, 0x00, 0x00, 0xA4, 0xFF, 0xFF, 0xFF,
444 0xA4, 0xFF, 0xFF, 0xFF, 0x45, 0xFF, 0xFF, 0xFF,
445 0x45, 0xFF, 0xFF, 0xFF ]
449 type: ARM_RELOC_SECTDIFF
461 type: ARM_RELOC_SECTDIFF
473 type: ARM_RELOC_SECTDIFF
485 type: ARM_RELOC_SECTDIFF
496 type: ARM_RELOC_VANILLA
502 type: ARM_RELOC_VANILLA
509 type: ARM_RELOC_VANILLA
514 type: ARM_RELOC_VANILLA
523 desc: [ N_ARM_THUMB_DEF ]
524 value: 0x0000000000000000
528 value: 0x00000000000000A0
532 desc: [ N_ARM_THUMB_DEF ]
533 value: 0x0000000000000056
537 value: 0x0000000000000058
542 value: 0x0000000000000000
545 # CHECK: defined-atoms:
549 # CHECK: - kind: pointer32
551 # CHECK: target: _foo_thumb
553 # CHECK: - kind: pointer32
555 # CHECK: target: _foo_thumb
557 # CHECK: - kind: pointer32
559 # CHECK: target: _undef
561 # CHECK: - kind: pointer32
563 # CHECK: target: _undef
565 # CHECK: - kind: delta32
567 # CHECK: target: _foo_arm
569 # CHECK: - kind: delta32
571 # CHECK: target: _foo_arm
573 # CHECK: - kind: delta32
575 # CHECK: target: _foo_thumb
577 # CHECK: - kind: delta32
579 # CHECK: target: _foo_thumb
581 # CHECK: - name: _foo_thumb
583 # CHECK: - kind: modeThumbCode
585 # CHECK: - kind: thumb_bl22
589 # CHECK: - kind: thumb_bl22
593 # CHECK: - kind: thumb_bl22
595 # CHECK: target: _undef
597 # CHECK: - kind: thumb_bl22
599 # CHECK: target: _undef
601 # CHECK: - kind: thumb_b22
603 # CHECK: target: _undef
605 # CHECK: - kind: thumb_movw_funcRel
609 # CHECK: - kind: thumb_movt_funcRel
613 # CHECK: - kind: thumb_movw_funcRel
617 # CHECK: - kind: thumb_movt_funcRel
621 # CHECK: - kind: thumb_movw_funcRel
625 # CHECK: - kind: thumb_movt_funcRel
629 # CHECK: - kind: thumb_movw
633 # CHECK: - kind: thumb_movt
637 # CHECK: - kind: thumb_movw
641 # CHECK: - kind: thumb_movt
645 # CHECK: - kind: thumb_movw
649 # CHECK: - kind: thumb_movt
653 # CHECK: - kind: thumb_movw
655 # CHECK: target: _undef
657 # CHECK: - kind: thumb_movt
659 # CHECK: target: _undef
661 # CHECK: - kind: thumb_movw
663 # CHECK: target: _undef
665 # CHECK: - kind: thumb_movt
667 # CHECK: target: _undef
670 # CHECK: content: [ C0, 46 ]
672 # CHECK: - kind: modeThumbCode
674 # CHECK: - name: _foo_arm
676 # CHECK-NOT: - kind: modeThumbCode
677 # CHECK: - kind: arm_bl24
681 # CHECK: - kind: arm_bl24
685 # CHECK: - kind: arm_bl24
687 # CHECK: target: _undef
689 # CHECK: - kind: arm_bl24
691 # CHECK: target: _undef
693 # CHECK: - kind: arm_b24
695 # CHECK: target: _undef
697 # CHECK: - kind: arm_movw_funcRel
701 # CHECK: - kind: arm_movt_funcRel
705 # CHECK: - kind: arm_movw_funcRel
709 # CHECK: - kind: arm_movt_funcRel
713 # CHECK: - kind: arm_movw
717 # CHECK: - kind: arm_movt
721 # CHECK: - kind: arm_movw
725 # CHECK: - kind: arm_movt
729 # CHECK: - kind: arm_movw
731 # CHECK: target: _undef
733 # CHECK: - kind: arm_movt
735 # CHECK: target: _undef
737 # CHECK: - kind: arm_movw
739 # CHECK: target: _undef
741 # CHECK: - kind: arm_movt
743 # CHECK: target: _undef
745 # CHECK: undefined-atoms:
746 # CHECK: - name: _undef
753 # .thumb_func _foo_thumb
760 # movw r1, :lower16:(_x-L1)
761 # movt r1, :upper16:(_x-L1)
762 # movw r2, :lower16:(_x+8-L1)
763 # movt r2, :upper16:(_x+8-L1)
764 # movw r1, :lower16:(_t1-L1)
765 # movt r1, :upper16:(_t1-L1)
768 # movw r3, :lower16:_x
769 # movt r3, :upper16:_x
770 # movw r4, :lower16:_x+8
771 # movt r4, :upper16:_x+8
772 # movw r3, :lower16:_t1
773 # movt r3, :upper16:_t1
774 # movw r5, :lower16:_undef
775 # movt r5, :upper16:_undef
776 # movw r6, :lower16:_undef+8
777 # movt r6, :upper16:_undef+8
792 # movw r1, :lower16:(_x-L2)
793 # movt r1, :upper16:(_x-L2)
794 # movw r2, :lower16:(_x+8-L2)
795 # movt r2, :upper16:(_x+8-L2)
798 # movw r3, :lower16:_x
799 # movt r3, :upper16:_x
800 # movw r4, :lower16:_x+8
801 # movt r4, :upper16:_x+8
802 # movw r5, :lower16:_undef
803 # movt r5, :upper16:_undef
804 # movw r6, :lower16:_undef+8
805 # movt r6, :upper16:_undef+8
815 # .long _foo_arm+4- .
816 # .long _foo_thumb - .
817 # .long _foo_thumb+4 - .