• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// REQUIRES: arm
2// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t
3// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %S/Inputs/far-arm-abs.s -o %tfar
4// RUN: echo "SECTIONS { \
5// RUN:          . = 0xb4; \
6// RUN:          .callee1 : { *(.callee_low) } \
7// RUN:          .caller : { *(.text) } \
8// RUN:          .callee2 : { *(.callee_high) } } " > %t.script
9// RUN: ld.lld --script %t.script %t %tfar -o %t2
10// RUN: llvm-objdump -d --no-show-raw-insn --triple=armv7a-none-linux-gnueabi %t2 | FileCheck  %s
11 .syntax unified
12 .section .callee_low, "ax",%progbits
13 .align 2
14 .type callee_low,%function
15callee_low:
16 bx lr
17
18 .section .text, "ax",%progbits
19 .globl _start
20 .balign 0x10000
21 .type _start,%function
22_start:
23 bl  callee_low
24 b   callee_low
25 beq callee_low
26 bl  callee_high
27 b   callee_high
28 bne callee_high
29 bl  far
30 b   far
31 bgt far
32 bx lr
33
34 .section .callee_high, "ax",%progbits
35 .align 2
36 .type callee_high,%function
37callee_high:
38 bx lr
39
40// CHECK: 00010000 <_start>:
41/// S(callee_low) = 0xb4 P = 0x10000 A = -8 = -0xff54 = -65364
42// CHECK-NEXT:   10000:       bl      #-65364 <callee_low>
43/// S(callee_low) = 0xb4 P = 0x10004 A = -8 = -0xff58 = -65368
44// CHECK-NEXT:   10004:       b       #-65368 <callee_low>
45/// S(callee_low) = 0xb4 P = 0x10008 A = -8 = -0xff5c -65372
46// CHECK-NEXT:   10008:       beq     #-65372 <callee_low>
47/// S(callee_high) = 0x10028 P = 0x1000c A = -8 = 0x14 = 20
48// CHECK-NEXT:   1000c:       bl      #28 <callee_high>
49/// S(callee_high) = 0x10028 P = 0x10010 A = -8 = 0x10 = 16
50// CHECK-NEXT:   10010:       b       #24 <callee_high>
51/// S(callee_high) = 0x10028 P = 0x10014 A = -8 = 0x0c =12
52// CHECK-NEXT:   10014:       bne     #20 <callee_high>
53/// S(far) = 0x201001c P = 0x10018 A = -8 = 0x1fffffc = 33554428
54// CHECK-NEXT:   10018:       bl      #8
55/// S(far) = 0x201001c P = 0x1001c A = -8 = 0x1fffff8 = 33554424
56// CHECK-NEXT:   1001c:       b       #4
57/// S(far) = 0x201001c P = 0x10020 A = -8 = 0x1fffff4 = 33554420
58// CHECK-NEXT:   10020:       bgt     #0
59// CHECK-NEXT:   10024:       bx      lr
60