binutils-gdb/gold/testsuite/arm_branch_out_of_range.sh

124 lines
4.1 KiB
Bash
Raw Normal View History

2010-09-08 Doug Kwan <dougkwan@google.com> * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method. (Arm_relobj::do_relocate_sections): Add new parameter for output file to match the parent. (Target_arm::scan_reloc_section_for_stubs): Use would-be final values of local symbols instead of input values. Update code to track changes in gold::relocate_section. * object.cc (Sized_relobj::compute_final_local_value): New methods. (Sized_relobj::compute_final_local_value_internal): New methods. (Sized_relobj::do_finalize_local_symbols): Move code from loop body into private version of Sized_relobj::compute_final_local_value. Call the inline method. * object.h (Symbol_value::Symbol_value): Define destructor. Free merged symbol value if there is one. (Symbol_value::has_output_value): New method defintiion. (Sized_relobj::Compute_final_local_value_status): New enum type. (Sized_relobj::compute_final_local_value): New methods. (Sized_relobj::compute_final_local_value_internal): New methods. * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh and arm_cortex_a8.sh. (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl, arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc): New tests. * Makefile.in: Regenerate. * testsuite/arm_bl_out_of_range.s: Update test. * testsuite/thumb_bl_out_of_range.s: Ditto. * testsuite/thumb_blx_out_of_range.s: Ditto. * testsuite/arm_branch_out_of_range.sh: New file. * testsuite/arm_cortex_a8.sh: Ditto. * testsuite/arm_cortex_a8_b.s: Ditto. * testsuite/arm_cortex_a8_b_cond.s: Ditto. * testsuite/arm_cortex_a8_b_local.s: Ditto. * testsuite/arm_cortex_a8_bl.s: Ditto. * testsuite/arm_cortex_a8_blx.s: Ditto. * testsuite/arm_cortex_a8_local.s: Ditto. * testsuite/arm_cortex_a8_local_reloc.s: Ditto. * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2010-09-09 07:54:51 +08:00
#!/bin/sh
# arm_branch_out_of_range.sh -- test ARM/THUMB/THUMB branch instructions whose
# targets are just out of the branch range limits.
# Copyright (C) 2010-2017 Free Software Foundation, Inc.
2010-09-08 Doug Kwan <dougkwan@google.com> * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method. (Arm_relobj::do_relocate_sections): Add new parameter for output file to match the parent. (Target_arm::scan_reloc_section_for_stubs): Use would-be final values of local symbols instead of input values. Update code to track changes in gold::relocate_section. * object.cc (Sized_relobj::compute_final_local_value): New methods. (Sized_relobj::compute_final_local_value_internal): New methods. (Sized_relobj::do_finalize_local_symbols): Move code from loop body into private version of Sized_relobj::compute_final_local_value. Call the inline method. * object.h (Symbol_value::Symbol_value): Define destructor. Free merged symbol value if there is one. (Symbol_value::has_output_value): New method defintiion. (Sized_relobj::Compute_final_local_value_status): New enum type. (Sized_relobj::compute_final_local_value): New methods. (Sized_relobj::compute_final_local_value_internal): New methods. * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh and arm_cortex_a8.sh. (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl, arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc): New tests. * Makefile.in: Regenerate. * testsuite/arm_bl_out_of_range.s: Update test. * testsuite/thumb_bl_out_of_range.s: Ditto. * testsuite/thumb_blx_out_of_range.s: Ditto. * testsuite/arm_branch_out_of_range.sh: New file. * testsuite/arm_cortex_a8.sh: Ditto. * testsuite/arm_cortex_a8_b.s: Ditto. * testsuite/arm_cortex_a8_b_cond.s: Ditto. * testsuite/arm_cortex_a8_b_local.s: Ditto. * testsuite/arm_cortex_a8_bl.s: Ditto. * testsuite/arm_cortex_a8_blx.s: Ditto. * testsuite/arm_cortex_a8_local.s: Ditto. * testsuite/arm_cortex_a8_local_reloc.s: Ditto. * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2010-09-09 07:54:51 +08:00
# Written by Doug Kwan <dougkwan@google.com>
# This file is part of gold.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
# This file goes with the assembler source files arm_bl_out_of_range.s,
# thumb_bl_out_of_range.s and thumb_bl_out_of_range_local.s that are assembled
# and linked to check that branches whose target are just out of the branch
# range limits are handle correctly.
check()
{
file=$1
pattern=$2
found=`grep "$pattern" $file`
if test -z "$found"; then
echo "pattern \"$pattern\" not found in file $file."
exit 1
fi
}
# This is a bit crude. Also, there are tabs in the grep patterns.
check arm_bl_out_of_range.stdout \
" 4000004: eb00003d bl 4000100 <.*>"
check arm_bl_out_of_range.stdout \
" 4000008: eb00003e bl 4000108 <.*>"
check arm_bl_out_of_range.stdout \
" 4000100: e51ff004 ldr pc, \[pc, #-4\]"
check arm_bl_out_of_range.stdout \
" 4000104: 02000008 "
check arm_bl_out_of_range.stdout \
" 4000108: e51ff004 ldr pc, \[pc, #-4\]"
check arm_bl_out_of_range.stdout \
" 400010c: 06000010 "
check thumb_bl_out_of_range.stdout \
" 800004: f000 e87c blx 800100 <.*>"
check thumb_bl_out_of_range.stdout \
" 800008: f000 e87e blx 800108 <.*>"
check thumb_bl_out_of_range.stdout \
" 800100: e51ff004 ldr pc, \[pc, #-4\]"
check thumb_bl_out_of_range.stdout \
" 800104: 00400007 "
check thumb_bl_out_of_range.stdout \
" 800108: e51ff004 ldr pc, \[pc, #-4\]"
check thumb_bl_out_of_range.stdout \
" 80010c: 00c0000d "
check thumb_blx_out_of_range.stdout \
" 800004: f000 e87c blx 800100 <.*>"
check thumb_blx_out_of_range.stdout \
" 80000a: f000 e87e blx 800108 <.*>"
check thumb_blx_out_of_range.stdout \
" 800100: e51ff004 ldr pc, \[pc, #-4\]"
check thumb_blx_out_of_range.stdout \
" 800104: 00400004 "
2010-09-08 Doug Kwan <dougkwan@google.com> * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method. (Arm_relobj::do_relocate_sections): Add new parameter for output file to match the parent. (Target_arm::scan_reloc_section_for_stubs): Use would-be final values of local symbols instead of input values. Update code to track changes in gold::relocate_section. * object.cc (Sized_relobj::compute_final_local_value): New methods. (Sized_relobj::compute_final_local_value_internal): New methods. (Sized_relobj::do_finalize_local_symbols): Move code from loop body into private version of Sized_relobj::compute_final_local_value. Call the inline method. * object.h (Symbol_value::Symbol_value): Define destructor. Free merged symbol value if there is one. (Symbol_value::has_output_value): New method defintiion. (Sized_relobj::Compute_final_local_value_status): New enum type. (Sized_relobj::compute_final_local_value): New methods. (Sized_relobj::compute_final_local_value_internal): New methods. * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh and arm_cortex_a8.sh. (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl, arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc): New tests. * Makefile.in: Regenerate. * testsuite/arm_bl_out_of_range.s: Update test. * testsuite/thumb_bl_out_of_range.s: Ditto. * testsuite/thumb_blx_out_of_range.s: Ditto. * testsuite/arm_branch_out_of_range.sh: New file. * testsuite/arm_cortex_a8.sh: Ditto. * testsuite/arm_cortex_a8_b.s: Ditto. * testsuite/arm_cortex_a8_b_cond.s: Ditto. * testsuite/arm_cortex_a8_b_local.s: Ditto. * testsuite/arm_cortex_a8_bl.s: Ditto. * testsuite/arm_cortex_a8_blx.s: Ditto. * testsuite/arm_cortex_a8_local.s: Ditto. * testsuite/arm_cortex_a8_local_reloc.s: Ditto. * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2010-09-09 07:54:51 +08:00
check thumb_blx_out_of_range.stdout \
" 800108: e51ff004 ldr pc, \[pc, #-4\]"
check thumb_blx_out_of_range.stdout \
" 80010c: 00c0000c "
check thumb_bl_out_of_range_local.stdout \
" 800004: f000 e87c blx 800100 <.*>"
check thumb_bl_out_of_range_local.stdout \
" 800008: f000 e87e blx 800108 <.*>"
check thumb_bl_out_of_range_local.stdout \
" 800100: e51ff004 ldr pc, \[pc, #-4\]"
check thumb_bl_out_of_range_local.stdout \
" 800104: 00400007 "
check thumb_bl_out_of_range_local.stdout \
" 800108: e51ff004 ldr pc, \[pc, #-4\]"
check thumb_bl_out_of_range_local.stdout \
" 80010c: 00c0000d "
check thumb2_bl_out_of_range.stdout \
" 2000004: f000 e87c blx 2000100 <.*>"
check thumb2_bl_out_of_range.stdout \
" 2000008: f000 e87e blx 2000108 <.*>"
check thumb2_bl_out_of_range.stdout \
" 2000100: e51ff004 ldr pc, \[pc, #-4\]"
check thumb2_bl_out_of_range.stdout \
" 2000104: 01000007 "
check thumb2_bl_out_of_range.stdout \
" 2000108: e51ff004 ldr pc, \[pc, #-4\]"
check thumb2_bl_out_of_range.stdout \
" 200010c: 0300000d "
check thumb2_blx_out_of_range.stdout \
" 2000004: f000 e87c blx 2000100 <.*>"
check thumb2_blx_out_of_range.stdout \
" 200000a: f000 e87e blx 2000108 <.*>"
check thumb2_blx_out_of_range.stdout \
" 2000100: e51ff004 ldr pc, \[pc, #-4\]"
check thumb2_blx_out_of_range.stdout \
" 2000104: 01000004 "
2010-09-08 Doug Kwan <dougkwan@google.com> * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method. (Arm_relobj::do_relocate_sections): Add new parameter for output file to match the parent. (Target_arm::scan_reloc_section_for_stubs): Use would-be final values of local symbols instead of input values. Update code to track changes in gold::relocate_section. * object.cc (Sized_relobj::compute_final_local_value): New methods. (Sized_relobj::compute_final_local_value_internal): New methods. (Sized_relobj::do_finalize_local_symbols): Move code from loop body into private version of Sized_relobj::compute_final_local_value. Call the inline method. * object.h (Symbol_value::Symbol_value): Define destructor. Free merged symbol value if there is one. (Symbol_value::has_output_value): New method defintiion. (Sized_relobj::Compute_final_local_value_status): New enum type. (Sized_relobj::compute_final_local_value): New methods. (Sized_relobj::compute_final_local_value_internal): New methods. * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh and arm_cortex_a8.sh. (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl, arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc): New tests. * Makefile.in: Regenerate. * testsuite/arm_bl_out_of_range.s: Update test. * testsuite/thumb_bl_out_of_range.s: Ditto. * testsuite/thumb_blx_out_of_range.s: Ditto. * testsuite/arm_branch_out_of_range.sh: New file. * testsuite/arm_cortex_a8.sh: Ditto. * testsuite/arm_cortex_a8_b.s: Ditto. * testsuite/arm_cortex_a8_b_cond.s: Ditto. * testsuite/arm_cortex_a8_b_local.s: Ditto. * testsuite/arm_cortex_a8_bl.s: Ditto. * testsuite/arm_cortex_a8_blx.s: Ditto. * testsuite/arm_cortex_a8_local.s: Ditto. * testsuite/arm_cortex_a8_local_reloc.s: Ditto. * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2010-09-09 07:54:51 +08:00
check thumb2_blx_out_of_range.stdout \
" 2000108: e51ff004 ldr pc, \[pc, #-4\]"
check thumb2_blx_out_of_range.stdout \
" 200010c: 0300000c "
exit 0