diff options
Diffstat (limited to 'test/mach-o/arm-interworking.yaml')
| -rw-r--r-- | test/mach-o/arm-interworking.yaml | 160 |
1 files changed, 43 insertions, 117 deletions
diff --git a/test/mach-o/arm-interworking.yaml b/test/mach-o/arm-interworking.yaml index f7e04e65c9f0..59c46050fab5 100644 --- a/test/mach-o/arm-interworking.yaml +++ b/test/mach-o/arm-interworking.yaml @@ -1,7 +1,8 @@ -# RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s -o %t | FileCheck %s \ +# RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s \ +# RUN: %p/Inputs/arm-interworking.yaml -o %t | FileCheck %s \ # RUN: && lld -flavor darwin -arch armv7 -dylib -print_atoms \ # RUN: %p/Inputs/libSystem.yaml %t -o %t2 | FileCheck %s \ -# RUN: && macho-dump --dump-section-data %t2 | FileCheck -check-prefix=CODE %s +# RUN: && llvm-readobj -s -sd %t2 | FileCheck -check-prefix=CODE %s # # Test thumb and arm branches round trip through -r. # Test bl/blx instructions are fixed up properly. @@ -12,20 +13,20 @@ arch: armv7 file-type: MH_OBJECT flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ] -sections: +sections: - segment: __TEXT section: __text type: S_REGULAR attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ] alignment: 2 address: 0x0000000000000000 - content: [ 0xFF, 0xF7, 0xFE, 0xFF, 0xC0, 0x46, 0xFF, 0xF7, - 0xFC, 0xEF, 0xC0, 0x46, 0xFF, 0xF7, 0xF8, 0xEF, - 0xFF, 0xF7, 0xF6, 0xFF, 0xC0, 0x46, 0xFF, 0xF7, - 0xF3, 0xFF, 0xC0, 0x46, 0x00, 0xF0, 0x06, 0xE8, - 0xC0, 0x46, 0x00, 0xF0, 0x03, 0xF8, 0x00, 0xF0, + content: [ 0xFF, 0xF7, 0xFE, 0xFF, 0xC0, 0x46, 0xFF, 0xF7, + 0xFC, 0xEF, 0xC0, 0x46, 0xFF, 0xF7, 0xF8, 0xEF, + 0xFF, 0xF7, 0xF6, 0xFF, 0xC0, 0x46, 0xFF, 0xF7, + 0xF3, 0xFF, 0xC0, 0x46, 0x00, 0xF0, 0x06, 0xE8, + 0xC0, 0x46, 0x00, 0xF0, 0x03, 0xF8, 0x00, 0xF0, 0x02, 0xF8, 0x70, 0x47, 0x70, 0x47, 0x70, 0x47 ] - relocations: + relocations: - offset: 0x00000026 type: ARM_THUMB_RELOC_BR22 length: 2 @@ -80,7 +81,7 @@ sections: attributes: [ ] address: 0x0000000000000030 content: [ 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ] - relocations: + relocations: - offset: 0x00000004 type: ARM_RELOC_VANILLA length: 2 @@ -93,7 +94,7 @@ sections: pc-rel: false extern: false symbol: 1 -local-symbols: +local-symbols: - name: _t3 type: N_SECT sect: 1 @@ -103,7 +104,7 @@ local-symbols: type: N_SECT sect: 2 value: 0x0000000000000030 -global-symbols: +global-symbols: - name: _t1 type: N_SECT scope: [ N_EXT ] @@ -116,7 +117,7 @@ global-symbols: sect: 1 desc: [ N_ARM_THUMB_DEF ] value: 0x000000000000002C -undefined-symbols: +undefined-symbols: - name: _a1 type: N_UNDF scope: [ N_EXT ] @@ -126,96 +127,13 @@ undefined-symbols: scope: [ N_EXT ] value: 0x0000000000000000 ---- !mach-o -arch: armv7 -file-type: MH_OBJECT -flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ] -sections: - - segment: __TEXT - section: __text - type: S_REGULAR - attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ] - alignment: 2 - address: 0x0000000000000000 - content: [ 0xFE, 0xFF, 0xFF, 0xEB, 0x02, 0x00, 0x00, 0xFA, - 0xFC, 0xFF, 0xFF, 0xEB, 0xFB, 0xFF, 0xFF, 0xFA, - 0x1E, 0xFF, 0x2F, 0xE1, 0x1E, 0xFF, 0x2F, 0xE1 ] - relocations: - - offset: 0x0000000C - type: ARM_RELOC_BR24 - length: 2 - pc-rel: true - extern: true - symbol: 4 - - offset: 0x00000008 - type: ARM_RELOC_BR24 - length: 2 - pc-rel: true - extern: true - symbol: 3 - - offset: 0x00000004 - type: ARM_RELOC_BR24 - length: 2 - pc-rel: true - extern: false - symbol: 1 - - offset: 0x00000000 - type: ARM_RELOC_BR24 - length: 2 - pc-rel: true - extern: false - symbol: 1 - - segment: __DATA - section: __data - type: S_REGULAR - attributes: [ ] - address: 0x0000000000000018 - content: [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ] - relocations: - - offset: 0x00000004 - type: ARM_RELOC_VANILLA - length: 2 - pc-rel: false - extern: false - symbol: 1 - - offset: 0x00000000 - type: ARM_RELOC_VANILLA - length: 2 - pc-rel: false - extern: true - symbol: 3 -local-symbols: - - name: _d2 - type: N_SECT - sect: 2 - value: 0x0000000000000018 -global-symbols: - - name: _a1 - type: N_SECT - scope: [ N_EXT ] - sect: 1 - value: 0x0000000000000000 - - name: _a2 - type: N_SECT - scope: [ N_EXT ] - sect: 1 - value: 0x0000000000000014 -undefined-symbols: - - name: _t1 - type: N_UNDF - scope: [ N_EXT ] - value: 0x0000000000000000 - - name: _t2 - type: N_UNDF - scope: [ N_EXT ] - value: 0x0000000000000000 ... -# CHECK: defined-atoms: +# CHECK: defined-atoms: # CHECK: - name: _d1 # CHECK: type: data -# CHECK: references: +# CHECK: references: # CHECK: - kind: pointer32 # CHECK: offset: 0 # CHECK: target: _t2 @@ -224,7 +142,7 @@ undefined-symbols: # CHECK: target: _a1 # CHECK: - name: _d2 # CHECK: type: data -# CHECK: references: +# CHECK: references: # CHECK: - kind: pointer32 # CHECK: offset: 0 # CHECK: target: _t1 @@ -233,7 +151,7 @@ undefined-symbols: # CHECK: target: _a1 # CHECK: - name: _t1 # CHECK: scope: global -# CHECK: references: +# CHECK: references: # CHECK: - kind: modeThumbCode # CHECK: offset: 0 # CHECK: target: _t1 @@ -264,19 +182,19 @@ undefined-symbols: # CHECK: - name: _t2 # CHECK: scope: global # CHECK: content: [ 70, 47 ] -# CHECK: references: +# CHECK: references: # CHECK: - kind: modeThumbCode # CHECK: offset: 0 # CHECK: target: _t2 # CHECK: - name: _t3 # CHECK: content: [ 70, 47 ] -# CHECK: references: +# CHECK: references: # CHECK: - kind: modeThumbCode # CHECK: offset: 0 # CHECK: target: _t3 # CHECK: - name: _a1 # CHECK: scope: global -# CHECK: references: +# CHECK: references: # CHECK: - kind: arm_bl24 # CHECK: offset: 0 # CHECK: target: _a1 @@ -292,15 +210,23 @@ undefined-symbols: # CHECK: - name: _a2 # CHECK: scope: global +# CODE: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) +# CODE: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) +# CODE: SectionData ( +# CODE: 0000: 00F016E8 C04600F0 1EE8C046 00F01AE8 +# CODE: 0010: FFF7F6FF C046FFF7 F3FFC046 00F006F8 +# CODE: 0020: C04600F0 03F800F0 02F87047 70477047 +# CODE: 0030: FEFFFFEB 020000EB F0FFFFFA FAFFFFFA +# CODE: 0040: 1EFF2FE1 1EFF2FE1 +# CODE: ) -# CODE: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') -# CODE: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') -# CODE: ('_section_data', '00f016e8 c04600f0 1ee8c046 00f01ae8 fff7f6ff c046fff7 f3ffc046 00f006f8 c04600f0 03f800f0 02f87047 70477047 feffffeb 020000eb f0fffffa fafffffa 1eff2fe1 1eff2fe1') -# When we get a good mach-o disassembler the above __text section content check can be change to be symbolic. +# CODE: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00) +# CODE: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00) +# CODE: SectionData ( +# CODE: 0000: E50F0000 E80F0000 B90F0000 E80F0000 +# CODE: ) -# CODE: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') -# CODE: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') -# CODE: ('_section_data', '{{[0-9a-f]}}{{[13579bdf]}}{{[0-9a-f]+}} {{[0-9a-f]}}{{[02468ade]}}{{[0-9a-f]+}} {{[0-9a-f]}}{{[13579bdf]}}{{[0-9a-f]+}} {{[0-9a-f]}}{{[02468ade]}}{{[0-9a-f]+}}') +# When we get a good mach-o disassembler the above __text section content check can be change to be symbolic. # Verify the low (thumb) bit is set on the first and third pointers but not the second and fourth. @@ -325,18 +251,18 @@ undefined-symbols: # nop # blx _t2 # bx lr -# +# # .globl _t2 # .thumb_func _t2 #_t2: # bx lr -# +# # .data #_d1: .long _t2 # .long _a1 - - + + # Input file two: # # .align 2 @@ -348,15 +274,15 @@ undefined-symbols: # bl _t1 # blx _t2 # bx lr -# +# # .globl _a2 #_a2: # bx lr -# +# # .data #_d2: .long _t1 # .long _a1 -
\ No newline at end of file + |
