File: MachO_Thumb_Relocations.s

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (61 lines) | stat: -rw-r--r-- 2,108 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# RUN: rm -rf %t && mkdir -p %t
# RUN: llvm-mc -triple=thumbv7s-apple-ios7.0.0 -filetype=obj -o %t/MachO_Thumb.o %s
# RUN: llvm-rtdyld -triple=thumbv7s-apple-ios7.0.0 -verify -check=%s %t/MachO_Thumb.o

        .section        __TEXT,__text,regular,pure_instructions
        .syntax unified

        .globl  thumb_caller_thumb_callee
        .p2align        1
        .code   16
        .thumb_func     thumb_caller_thumb_callee
thumb_caller_thumb_callee:
        nop

        .globl  arm_caller_thumb_callee
        .p2align        1
        .code   16
        .thumb_func     arm_caller_thumb_callee
arm_caller_thumb_callee:
        nop

        .globl  thumb_caller_arm_callee
        .p2align        1
        .code   32
thumb_caller_arm_callee:
        nop

        .globl  thumb_caller
        .p2align        1
        .code   16
        .thumb_func     thumb_caller
thumb_caller:
        nop

# Check that stubs for thumb callers use thumb code (not arm), and that thumb
# callees have the low bit set on their addresses.
#
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_thumb_callee)) = 0xf000f8df
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_thumb_callee) + 4) = (thumb_caller_thumb_callee | 0x1)
        bl thumb_caller_thumb_callee

# Check that arm callees do not have the low bit set on their addresses.
#
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_arm_callee)) = 0xf000f8df
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_arm_callee) + 4) = thumb_caller_arm_callee
        bl thumb_caller_arm_callee

        .globl  arm_caller
        .p2align        2
        .code   32
arm_caller:
        nop

# Check that stubs for arm callers use arm code (not thumb), and that thumb
# callees have the low bit set on their addresses.
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, arm_caller_thumb_callee)) = 0xe51ff004
# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, arm_caller_thumb_callee) + 4) = (arm_caller_thumb_callee | 0x1)
        bl      arm_caller_thumb_callee
        nop

.subsections_via_symbols