arm-thumb-interwork-shared.s
2.05 KB
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
// REQUIRES: arm
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumbv7a-none-linux-gnueabi %s -o %t
// RUN: ld.lld %t --shared -o %t.so
// RUN: llvm-objdump -d --no-show-raw-insn --triple=thumbv7a-none-linux-gnueabi %t.so | FileCheck %s
.syntax unified
.global sym1
.global elsewhere
.weak weakref
sym1:
b.w elsewhere
b.w weakref
bl elsewhere
bl weakref
// Check that we generate a thunk for an undefined symbol called via a plt
// entry.
// CHECK: Disassembly of section .text:
// CHECK-EMPTY:
// CHECK-NEXT: <sym1>:
// CHECK-NEXT: 101e0: b.w #12 <__ThumbV7PILongThunk_elsewhere>
// CHECK-NEXT: b.w #20 <__ThumbV7PILongThunk_weakref>
// CHECK-NEXT: blx #68
// CHECK-NEXT: blx #80
// CHECK: <__ThumbV7PILongThunk_elsewhere>:
// CHECK-NEXT: 101f0: movw r12, #52
// CHECK-NEXT: movt r12, #0
// CHECK-NEXT: add r12, pc
// CHECK-NEXT: bx r12
// CHECK: <__ThumbV7PILongThunk_weakref>:
// CHECK-NEXT: 101fc: movw r12, #56
// CHECK-NEXT: movt r12, #0
// CHECK-NEXT: add r12, pc
// CHECK-NEXT: bx r12
// CHECK: Disassembly of section .plt:
// CHECK-EMPTY:
// CHECK-NEXT: <$a>:
// CHECK-NEXT: 10210: str lr, [sp, #-4]!
// CHECK-NEXT: add lr, pc, #0, #12
// CHECK-NEXT: add lr, lr, #32
// CHECK-NEXT: ldr pc, [lr, #148]!
// CHECK: <$d>:
// CHECK-NEXT: 10220: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK-NEXT: .word 0xd4d4d4d4
// CHECK-NEXT: .word 0xd4d4d4d4
// CHECK-NEXT: .word 0xd4d4d4d4
// CHECK: <$a>:
// CHECK-NEXT: 10230: add r12, pc, #0, #12
// CHECK-NEXT: add r12, r12, #32
// CHECK-NEXT: ldr pc, [r12, #124]!
// CHECK: <$d>:
// CHECK-NEXT: 1023c: d4 d4 d4 d4 .word 0xd4d4d4d4
// CHECK: <$a>:
// CHECK-NEXT: 10240: add r12, pc, #0, #12
// CHECK-NEXT: add r12, r12, #32
// CHECK-NEXT: ldr pc, [r12, #112]!
// CHECK: <$d>:
// CHECK-NEXT: 1024c: d4 d4 d4 d4 .word 0xd4d4d4d4