Home | History | Annotate | Download | only in testsuite
      1 # thumb_bl_out_of_range.s
      2 # Test THUMB/THUMB-2 bl 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.
      8 	.space	6
      9 
     10 	.global	_backward_target
     11 	.code	16
     12 	.thumb_func
     13 	.type	_backword_target, %function
     14 _backward_target:
     15 	bx	lr
     16 	.size	_backward_target, .-_backward_target
     17 
     18 	.text
     19 # Use 256-byte alignment so that we know where the stubs start.
     20 	.align	8
     21 
     22 # Define _start so that linker does not complain.
     23 	.global	_start
     24 	.code	32
     25 	.align	2
     26 	.type	_start, %function
     27 _start:
     28 	bx	lr
     29 	.size	_start, .-_start
     30 
     31 	.global	_backward_test
     32 	.code	16
     33 	.thumb_func
     34 	.type	_backward_test, %function
     35 _backward_test:
     36 	bl	_backward_target
     37 	.size	_backward_test, .-_backward_test
     38 
     39 	.global	_forward_test
     40 	.code	16
     41 	.thumb_func
     42 	.type	_forward_test, %function
     43 _forward_test:
     44 	bl	_forward_target
     45 	.size	_forward_test, .-_forward_test
     46 
     47 # switch back to ARM mode so that stubs are disassembled correctly.
     48 	.code	32
     49 	nop
     50 
     51 	.section	.text.post,"x"
     52 
     53 # Add padding so that target is just out of branch range.
     54 	.space	12
     55 
     56 	.global	_forward_target
     57 	.code	16
     58 	.thumb_func
     59 	.type	_forward_target, %function
     60 _forward_target:
     61 	bx	lr
     62 	.size	_forward_target, .-_forward_target
     63