File: ELF_stubs_thumb.s

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-10.1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 1,999,140 kB
  • sloc: cpp: 6,951,711; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,033; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,252; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (52 lines) | stat: -rw-r--r-- 1,705 bytes parent folder | download | duplicates (15)
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
# RUN: rm -rf %t && mkdir -p %t/thumbv7m && mkdir -p %t/thumbv7
#
# RUN: llvm-mc -triple=thumbv7m-linux-gnueabi -arm-add-build-attributes \
# RUN:         -filetype=obj -o %t/thumbv7m/out.o %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 \
# RUN:              -slab-allocate 10Kb -slab-page-size 4096 \
# RUN:              -abs ext=0x76bbe880 -check %s %t/thumbv7m/out.o
#
# RUN: llvm-mc -triple=thumbv7-linux-gnueabi -arm-add-build-attributes \
# RUN:         -filetype=obj -o %t/thumbv7/out.o %s
# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 \
# RUN:              -slab-allocate 10Kb -slab-page-size 4096 \
# RUN:              -abs ext=0x76bbe880 -check %s %t/thumbv7/out.o


	.text
	.syntax unified

# Check that calls/jumps to external functions trigger the generation of
# branch-range extension stubs. These stubs don't follow the default PLT model
# where the branch-target address is loaded from a GOT entry. Instead, they
# hard-code it in the immediate field.
#
# jitlink-check: decode_operand(test_external_call, 2) = stub_addr(out.o, ext) - next_pc(test_external_call)
# jitlink-check: decode_operand(test_external_jump, 0) = stub_addr(out.o, ext) - next_pc(test_external_jump)
	.globl  test_external_call
	.type	test_external_call,%function
	.p2align	1
	.code	16
	.thumb_func
test_external_call:
	bl	ext
	.size test_external_call, .-test_external_call

	.globl  test_external_jump
	.type	test_external_jump,%function
	.p2align	1
	.code	16
	.thumb_func
test_external_jump:
	b	ext
	.size test_external_jump, .-test_external_jump

# Empty main function for jitlink to be happy
	.globl	main
	.type	main,%function
	.p2align	1
	.code	16
	.thumb_func
main:
	bx	lr
	.size	main,	.-main