1 # RUN: ld64.lld -arch armv7 -r -print_atoms %s \
2 # RUN: %p/Inputs/arm-interworking.yaml -o %t | FileCheck %s \
3 # RUN: && ld64.lld -arch armv7 -dylib -print_atoms \
4 # RUN: %p/Inputs/armv7/libSystem.yaml %t -o %t2 | FileCheck %s \
5 # RUN: && llvm-readobj -s -sd %t2 | FileCheck -check-prefix=CODE %s
7 # Test thumb and arm branches round trip through -r.
8 # Test bl/blx instructions are fixed up properly.
15 flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
20 attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
22 address: 0x0000000000000000
23 content: [ 0xFF, 0xF7, 0xFE, 0xFF, 0xC0, 0x46, 0xFF, 0xF7,
24 0xFC, 0xEF, 0xC0, 0x46, 0xFF, 0xF7, 0xF8, 0xEF,
25 0xFF, 0xF7, 0xF6, 0xFF, 0xC0, 0x46, 0xFF, 0xF7,
26 0xF3, 0xFF, 0xC0, 0x46, 0x00, 0xF0, 0x06, 0xE8,
27 0xC0, 0x46, 0x00, 0xF0, 0x03, 0xF8, 0x00, 0xF0,
28 0x02, 0xF8, 0x70, 0x47, 0x70, 0x47, 0x70, 0x47 ]
31 type: ARM_THUMB_RELOC_BR22
37 type: ARM_THUMB_RELOC_BR22
43 type: ARM_THUMB_RELOC_BR22
49 type: ARM_THUMB_RELOC_BR22
55 type: ARM_THUMB_RELOC_BR22
61 type: ARM_THUMB_RELOC_BR22
67 type: ARM_THUMB_RELOC_BR22
73 type: ARM_THUMB_RELOC_BR22
82 address: 0x0000000000000030
83 content: [ 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
86 type: ARM_RELOC_VANILLA
92 type: ARM_RELOC_VANILLA
101 desc: [ N_ARM_THUMB_DEF ]
102 value: 0x000000000000002E
106 value: 0x0000000000000030
112 desc: [ N_ARM_THUMB_DEF ]
113 value: 0x0000000000000000
118 desc: [ N_ARM_THUMB_DEF ]
119 value: 0x000000000000002C
124 value: 0x0000000000000000
128 value: 0x0000000000000000
133 # CHECK: defined-atoms:
137 # CHECK: - kind: pointer32
140 # CHECK: - kind: pointer32
146 # CHECK: - kind: pointer32
149 # CHECK: - kind: pointer32
153 # CHECK: scope: global
155 # CHECK: - kind: modeThumbCode
158 # CHECK: - kind: thumb_bl22
161 # CHECK: - kind: thumb_bl22
164 # CHECK: - kind: thumb_bl22
167 # CHECK: - kind: thumb_bl22
170 # CHECK: - kind: thumb_bl22
173 # CHECK: - kind: thumb_bl22
176 # CHECK: - kind: thumb_bl22
179 # CHECK: - kind: thumb_bl22
183 # CHECK: scope: global
184 # CHECK: content: [ 70, 47 ]
186 # CHECK: - kind: modeThumbCode
190 # CHECK: content: [ 70, 47 ]
192 # CHECK: - kind: modeThumbCode
196 # CHECK: scope: global
198 # CHECK: - kind: arm_bl24
201 # CHECK: - kind: arm_bl24
204 # CHECK: - kind: arm_bl24
207 # CHECK: - kind: arm_bl24
211 # CHECK: scope: global
213 # CODE: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
214 # CODE: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
215 # CODE: SectionData (
216 # CODE: 0000: 00F016E8 C04600F0 1EE8C046 00F01AE8
217 # CODE: 0010: FFF7F6FF C046FFF7 F3FFC046 00F006F8
218 # CODE: 0020: C04600F0 03F800F0 02F87047 70477047
219 # CODE: 0030: FEFFFFEB 020000EB F0FFFFFA FAFFFFFA
220 # CODE: 0040: 1EFF2FE1 1EFF2FE1
223 # CODE: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
224 # CODE: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
225 # CODE: SectionData (
226 # CODE: 0000: E50F0000 E80F0000 B90F0000 E80F0000
229 # When we get a good mach-o disassembler the above __text section content check can be change to be symbolic.
230 # Verify the low (thumb) bit is set on the first and third pointers but not the second and fourth.