* testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
[deliverable/binutils-gdb.git] / gold / testsuite / thumb_blx_out_of_range.s
CommitLineData
a2c7281b
DK
1# thumb_blx_out_of_range.s
2# Test THUMB/THUMB-2 blx instructions just out of the branch range limits.
3 .syntax unified
4
5 .section .text.pre,"x"
6
7# Add padding so that target is just output of branch range.
81e015e2 8 .space 4
a2c7281b
DK
9
10 .global _forward_target
11 .global _backward_target
12 .type _backword_target, %function
13_backward_target:
14 bx lr
15 .size _backward_target, .-_backward_target
16
17 .text
aa98ff75
DK
18# Use 256-byte alignment so that we know where the stubs start.
19 .align 8
a2c7281b
DK
20
21# Define _start so that linker does not complain.
22 .align 2
23 .global _start
24 .code 32
25 .type _start, %function
26_start:
27 bx lr
28 .size _start, .-_start
29
30 .global _backward_test
31 .code 16
32 .thumb_func
33 .type _backward_test, %function
34_backward_test:
35 bl _backward_target
36 .size _backward_test, .-_backward_test
37
38 .align 2
39 .global _forward_test
40 .code 16
41 .thumb_func
42 .type _forward_test, %function
43_forward_test:
44 # Bit 1 of the BLX target comes from bit 1 of branch base address,
45 # which is BLX instruction's address + 4. We intentionally put this
46 # forward BLX at an address n*4 + 2 so that the branch offset is
47 # bumped up by 2.
48 nop.n
49 bl _forward_target
50 .size _forward_test, .-_forward_test
aa98ff75
DK
51
52# switch back to ARM mode so that stubs are disassembled correctly.
a2c7281b 53 .code 32
aa98ff75 54 nop
a2c7281b
DK
55
56 .section .text.post,"x"
57
58# Add padding so that target is just out of branch range.
59 .space 12
60 .align 2
61 .code 32
62 .global _forward_target
63 .type _forward_target, %function
64_forward_target:
65 bx lr
66 .size _forward_target, .-_forward_target
This page took 0.074829 seconds and 4 git commands to generate.