File: arm-bl-v6-inrange.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (50 lines) | stat: -rw-r--r-- 1,596 bytes parent folder | download | duplicates (12)
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
// REQUIRES: arm
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv6-none-linux-gnueabi %s -o %t
// RUN: echo "SECTIONS { \
// RUN:          .callee1 0x100004 : { *(.callee_low) } \
// RUN:          .caller  0x500000 : { *(.text) } \
// RUN:          .callee2 0x900004 : { *(.callee_high) } } " > %t.script
// RUN: ld.lld %t --script %t.script -o %t2
// RUN: llvm-objdump -d --triple=armv6-none-linux-gnueabi %t2 | FileCheck %s

// On older Arm Architectures such as v5 and v6 the Thumb BL and BLX relocation
// uses a slightly different encoding that has a lower range. These relocations
// are at the extreme range of what is permitted.
 .thumb
 .text
 .syntax unified
 .cpu    arm1176jzf-s
 .globl _start
 .type   _start,%function
_start:
  bl thumbfunc
  bl armfunc
  bx lr

  .section .callee_low, "ax", %progbits
  .globl thumbfunc
  .type thumbfunc, %function
thumbfunc:
  bx lr
// CHECK: Disassembly of section .callee1:
// CHECK-EMPTY:
// CHECK-NEXT: <thumbfunc>:
// CHECK-NEXT:   100004:       4770    bx      lr
// CHECK-EMPTY:
// CHECK-NEXT: Disassembly of section .caller:
// CHECK-EMPTY:
// CHECK-NEXT: <_start>:
// CHECK-NEXT:   500000:       f400 f800       bl     0x100004 <thumbfunc>
// CHECK-NEXT:   500004:       f3ff effe       blx    0x900004 <armfunc>
// CHECK-NEXT:   500008:       4770    bx      lr

  .section .callee_high, "ax", %progbits
  .arm
  .globl armfunc
  .type armfunc, %function
armfunc:
  bx lr
// CHECK: Disassembly of section .callee2:
// CHECK-EMPTY:
// CHECK-NEXT: <armfunc>:
// CHECK-NEXT:   900004:       e12fff1e        bx      lr