2010-02-21 Doug Kwan <dougkwan@google.com>
* arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
handling of the maximum backward branch offset.
(Arm_relocate_functions::thumb_branch_common): Ditto.
* testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
(check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
(arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
arm_bl_out_of_range.stdout, arm_bl_out_of_range,
arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
thumb_bl_out_of_range thumb_bl_out_of_range.o,
thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
thumb2_bl_out_of_range.o): New rules.
(MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
thumb2_bl_out_of_range
* testsuite/Makefile.in: Regenerate.
* testsuite/arm_bl_in_range.s: New file.
* testsuite/arm_bl_out_of_range.s: Ditto.
* testsuite/arm_branch_in_range.sh: Ditto.
* testsuite/arm_branch_range.t: Ditto.
* testsuite/thumb2_branch_range.t: Ditto.
* testsuite/thumb_bl_in_range.s: Ditto.
* testsuite/thumb_bl_out_of_range.s: Ditto.
* testsuite/thumb_branch_range.t: Ditto.
2010-02-22 14:26:07 +08:00
|
|
|
# thumb_bl_out_of_range.s
|
|
|
|
# Test THUMB/THUMB-2 bl instructions just out of the branch range limits.
|
|
|
|
.syntax unified
|
|
|
|
|
|
|
|
.section .text.pre,"x"
|
|
|
|
|
|
|
|
# Add padding so that target is just output of branch range.
|
|
|
|
.space 6
|
|
|
|
|
|
|
|
.global _backward_target
|
|
|
|
.code 16
|
|
|
|
.thumb_func
|
|
|
|
.type _backword_target, %function
|
|
|
|
_backward_target:
|
|
|
|
bx lr
|
|
|
|
.size _backward_target, .-_backward_target
|
|
|
|
|
|
|
|
.text
|
2010-09-09 07:54:51 +08:00
|
|
|
# Use 256-byte alignment so that we know where the stubs start.
|
|
|
|
.align 8
|
2010-02-21 Doug Kwan <dougkwan@google.com>
* arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
handling of the maximum backward branch offset.
(Arm_relocate_functions::thumb_branch_common): Ditto.
* testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
(check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
(arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
arm_bl_out_of_range.stdout, arm_bl_out_of_range,
arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
thumb_bl_out_of_range thumb_bl_out_of_range.o,
thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
thumb2_bl_out_of_range.o): New rules.
(MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
thumb2_bl_out_of_range
* testsuite/Makefile.in: Regenerate.
* testsuite/arm_bl_in_range.s: New file.
* testsuite/arm_bl_out_of_range.s: Ditto.
* testsuite/arm_branch_in_range.sh: Ditto.
* testsuite/arm_branch_range.t: Ditto.
* testsuite/thumb2_branch_range.t: Ditto.
* testsuite/thumb_bl_in_range.s: Ditto.
* testsuite/thumb_bl_out_of_range.s: Ditto.
* testsuite/thumb_branch_range.t: Ditto.
2010-02-22 14:26:07 +08:00
|
|
|
|
|
|
|
# Define _start so that linker does not complain.
|
|
|
|
.global _start
|
|
|
|
.code 32
|
|
|
|
.align 2
|
|
|
|
.type _start, %function
|
|
|
|
_start:
|
|
|
|
bx lr
|
|
|
|
.size _start, .-_start
|
|
|
|
|
|
|
|
.global _backward_test
|
|
|
|
.code 16
|
|
|
|
.thumb_func
|
|
|
|
.type _backward_test, %function
|
|
|
|
_backward_test:
|
|
|
|
bl _backward_target
|
|
|
|
.size _backward_test, .-_backward_test
|
|
|
|
|
|
|
|
.global _forward_test
|
|
|
|
.code 16
|
|
|
|
.thumb_func
|
|
|
|
.type _forward_test, %function
|
|
|
|
_forward_test:
|
|
|
|
bl _forward_target
|
|
|
|
.size _forward_test, .-_forward_test
|
|
|
|
|
2010-09-09 07:54:51 +08:00
|
|
|
# switch back to ARM mode so that stubs are disassembled correctly.
|
2015-07-07 06:02:40 +08:00
|
|
|
.align 2
|
2010-09-09 07:54:51 +08:00
|
|
|
.code 32
|
2015-07-07 06:02:40 +08:00
|
|
|
|
|
|
|
# Align stub table for address matching.
|
|
|
|
.align 8
|
2010-09-09 07:54:51 +08:00
|
|
|
|
2010-02-21 Doug Kwan <dougkwan@google.com>
* arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
handling of the maximum backward branch offset.
(Arm_relocate_functions::thumb_branch_common): Ditto.
* testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
(check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
(arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
arm_bl_out_of_range.stdout, arm_bl_out_of_range,
arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
thumb_bl_out_of_range thumb_bl_out_of_range.o,
thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
thumb2_bl_out_of_range.o): New rules.
(MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
thumb2_bl_out_of_range
* testsuite/Makefile.in: Regenerate.
* testsuite/arm_bl_in_range.s: New file.
* testsuite/arm_bl_out_of_range.s: Ditto.
* testsuite/arm_branch_in_range.sh: Ditto.
* testsuite/arm_branch_range.t: Ditto.
* testsuite/thumb2_branch_range.t: Ditto.
* testsuite/thumb_bl_in_range.s: Ditto.
* testsuite/thumb_bl_out_of_range.s: Ditto.
* testsuite/thumb_branch_range.t: Ditto.
2010-02-22 14:26:07 +08:00
|
|
|
.section .text.post,"x"
|
|
|
|
|
|
|
|
# Add padding so that target is just out of branch range.
|
|
|
|
.space 12
|
|
|
|
|
|
|
|
.global _forward_target
|
|
|
|
.code 16
|
|
|
|
.thumb_func
|
|
|
|
.type _forward_target, %function
|
|
|
|
_forward_target:
|
|
|
|
bx lr
|
|
|
|
.size _forward_target, .-_forward_target
|