diff options
author | Ian Lance Taylor <ian@airs.com> | 2011-11-02 19:11:48 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2011-11-02 19:11:48 +0000 |
commit | cd6eab1c16716e4e52828c0411f1dadfc14334cc (patch) | |
tree | db8c4e22d95a21e4b9c70f6a189c1d229061bcbe /gold/testsuite | |
parent | f179e16214758688265c2a0798bb2bebc0cd2770 (diff) | |
download | gdb-cd6eab1c16716e4e52828c0411f1dadfc14334cc.zip gdb-cd6eab1c16716e4e52828c0411f1dadfc14334cc.tar.gz gdb-cd6eab1c16716e4e52828c0411f1dadfc14334cc.tar.bz2 |
* arm.cc (Target_arm::Target_arm): Remove initialisation of
may_use_blx_.
(Target_arm::may_use_blx): Remove method.
(Target_arm::set_may_use_blx): Likewise.
(Target_arm::may_use_v4t_interworking): New method.
(Target_arm::may_use_v5t_interworking): Likewise.
(Target_arm::may_use_blx_): Remove member variable.
(Arm_relocate_functions::arm_branch_common): Check for v5T
interworking.
(Arm_relocate_functions::thumb_branch_common): Likewise.
(Reloc_stub::stub_type_for_reloc): Likewise.
(Target_arm::do_finalize_sections): Correct interworking checks.
* testsuite/Makefile.am: Add new tests.
* testsuite/Makefile.in: Regenerate.
* testsuite/arm_farcall_arm_arm.s: New test.
* testsuite/arm_farcall_arm_arm.sh: Likewise.
* testsuite/arm_farcall_arm_thumb.s: Likewise.
* testsuite/arm_farcall_arm_thumb.sh: Likewise.
* testsuite/arm_farcall_thumb_arm.s: Likewise.
* testsuite/arm_farcall_thumb_arm.sh: Likewise.
* testsuite/arm_farcall_thumb_thumb.s: Likewise.
* testsuite/arm_farcall_thumb_thumb.sh: Likewise.
Diffstat (limited to 'gold/testsuite')
-rw-r--r-- | gold/testsuite/Makefile.am | 114 | ||||
-rw-r--r-- | gold/testsuite/Makefile.in | 125 | ||||
-rw-r--r-- | gold/testsuite/arm_farcall_arm_arm.s | 20 | ||||
-rwxr-xr-x | gold/testsuite/arm_farcall_arm_arm.sh | 44 | ||||
-rw-r--r-- | gold/testsuite/arm_farcall_arm_thumb.s | 20 | ||||
-rwxr-xr-x | gold/testsuite/arm_farcall_arm_thumb.sh | 50 | ||||
-rw-r--r-- | gold/testsuite/arm_farcall_thumb_arm.s | 27 | ||||
-rwxr-xr-x | gold/testsuite/arm_farcall_thumb_arm.sh | 56 | ||||
-rw-r--r-- | gold/testsuite/arm_farcall_thumb_thumb.s | 19 | ||||
-rwxr-xr-x | gold/testsuite/arm_farcall_thumb_thumb.sh | 74 |
10 files changed, 546 insertions, 3 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index 06e1fd2..8666935 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -2471,6 +2471,120 @@ arm_unaligned_reloc.o: arm_unaligned_reloc.s MOSTLYCLEANFILES += arm_unaligned_reloc +# Check ARM to ARM farcall veneers + +check_SCRIPTS += arm_farcall_arm_arm.sh +check_DATA += arm_farcall_arm_arm.stdout + +arm_farcall_arm_arm.stdout: arm_farcall_arm_arm + $(TEST_OBJDUMP) -d $< > $@ + +arm_farcall_arm_arm: arm_farcall_arm_arm.o ../ld-new + ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001020 -o $@ $< + +arm_farcall_arm_arm.o: arm_farcall_arm_arm.s + $(TEST_AS) -o $@ $< + +MOSTLYCLEANFILES += arm_farcall_arm_arm + +# Check ARM to Thumb farcall veneers + +check_SCRIPTS += arm_farcall_arm_thumb.sh +check_DATA += arm_farcall_arm_thumb.stdout arm_farcall_arm_thumb_5t.stdout + +arm_farcall_arm_thumb.stdout: arm_farcall_arm_thumb + $(TEST_OBJDUMP) -D $< > $@ + +arm_farcall_arm_thumb: arm_farcall_arm_thumb.o ../ld-new + ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +arm_farcall_arm_thumb.o: arm_farcall_arm_thumb.s + $(TEST_AS) -o $@ $< + +arm_farcall_arm_thumb_5t.stdout: arm_farcall_arm_thumb_5t + $(TEST_OBJDUMP) -D $< > $@ + +arm_farcall_arm_thumb_5t: arm_farcall_arm_thumb_5t.o ../ld-new + ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +arm_farcall_arm_thumb_5t.o: arm_farcall_arm_thumb.s + $(TEST_AS) -march=armv5t -o $@ $< + +MOSTLYCLEANFILES += arm_farcall_arm_thumb arm_farcall_arm_thumb_5t + +# Check Thumb to Thumb farcall veneers + +check_SCRIPTS += arm_farcall_thumb_thumb.sh +check_DATA += arm_farcall_thumb_thumb.stdout \ + arm_farcall_thumb_thumb_5t.stdout \ + arm_farcall_thumb_thumb_7m.stdout \ + arm_farcall_thumb_thumb_6m.stdout + +arm_farcall_thumb_thumb.stdout: arm_farcall_thumb_thumb + $(TEST_OBJDUMP) -D $< > $@ + +arm_farcall_thumb_thumb: arm_farcall_thumb_thumb.o ../ld-new + ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +arm_farcall_thumb_thumb.o: arm_farcall_thumb_thumb.s + $(TEST_AS) -march=armv4t -o $@ $< + +arm_farcall_thumb_thumb_5t.stdout: arm_farcall_thumb_thumb_5t + $(TEST_OBJDUMP) -D $< > $@ + +arm_farcall_thumb_thumb_5t: arm_farcall_thumb_thumb_5t.o ../ld-new + ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +arm_farcall_thumb_thumb_5t.o: arm_farcall_thumb_thumb.s + $(TEST_AS) -march=armv5t -o $@ $< + +arm_farcall_thumb_thumb_7m.stdout: arm_farcall_thumb_thumb_7m + $(TEST_OBJDUMP) -D $< > $@ + +arm_farcall_thumb_thumb_7m: arm_farcall_thumb_thumb_7m.o ../ld-new + ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +arm_farcall_thumb_thumb_7m.o: arm_farcall_thumb_thumb.s + $(TEST_AS) -march=armv7-m -o $@ $< + +arm_farcall_thumb_thumb_6m.stdout: arm_farcall_thumb_thumb_6m + $(TEST_OBJDUMP) -D $< > $@ + +arm_farcall_thumb_thumb_6m: arm_farcall_thumb_thumb_6m.o ../ld-new + ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s + $(TEST_AS) -march=armv6-m -o $@ $< + +MOSTLYCLEANFILES += arm_farcall_thumb_thumb arm_farcall_thumb_thumb_5t \ + arm_farcall_thumb_thumb_7m arm_farcall_thumb_thumb_6m + +# Check Thumb to ARM farcall veneers + +check_SCRIPTS += arm_farcall_thumb_arm.sh +check_DATA += arm_farcall_thumb_arm.stdout \ + arm_farcall_thumb_arm_5t.stdout + +arm_farcall_thumb_arm.stdout: arm_farcall_thumb_arm + $(TEST_OBJDUMP) -D $< > $@ + +arm_farcall_thumb_arm: arm_farcall_thumb_arm.o ../ld-new + ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< + +arm_farcall_thumb_arm.o: arm_farcall_thumb_arm.s + $(TEST_AS) -o $@ $< + +arm_farcall_thumb_arm_5t.stdout: arm_farcall_thumb_arm_5t + $(TEST_OBJDUMP) -D $< > $@ + +arm_farcall_thumb_arm_5t: arm_farcall_thumb_arm_5t.o ../ld-new + ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< + +arm_farcall_thumb_arm_5t.o: arm_farcall_thumb_arm.s + $(TEST_AS) -march=armv5t -o $@ $< + +MOSTLYCLEANFILES += arm_farcall_thumb_arm arm_farcall_thumb_arm_5t + endif DEFAULT_TARGET_ARM endif NATIVE_OR_CROSS_LINKER diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in index 0b4cd1c..09c28d2 100644 --- a/gold/testsuite/Makefile.in +++ b/gold/testsuite/Makefile.in @@ -509,6 +509,14 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ # Cortex-A8 workaround test. + +# Check ARM to ARM farcall veneers + +# Check ARM to Thumb farcall veneers + +# Check Thumb to Thumb farcall veneers + +# Check Thumb to ARM farcall veneers @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_64 = arm_abs_global.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_in_range.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_branch_out_of_range.sh \ @@ -517,7 +525,11 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_cortex_a8.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_exidx_test.sh \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr12826.sh \ -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_unaligned_reloc.sh +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_unaligned_reloc.sh \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_arm.sh \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_thumb.sh \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb.sh \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm.sh @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_65 = arm_abs_global.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range.stdout \ @@ -546,7 +558,16 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_cortex_a8_local_reloc.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_exidx_test.stdout \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ pr12826.stdout \ -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_unaligned_reloc.stdout +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_unaligned_reloc.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_arm.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_thumb.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_thumb_5t.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_5t.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_7m.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_6m.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm.stdout \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm_5t.stdout @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@am__append_66 = arm_abs_global \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_in_range \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_bl_out_of_range \ @@ -573,7 +594,16 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_cortex_a8_blx \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_cortex_a8_local \ @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_cortex_a8_local_reloc \ -@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_unaligned_reloc +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_unaligned_reloc \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_arm \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_thumb \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_arm_thumb_5t \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_5t \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_7m \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_thumb_6m \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm \ +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ arm_farcall_thumb_arm_5t subdir = testsuite DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -3688,6 +3718,14 @@ pr12826.sh.log: pr12826.sh @p='pr12826.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) arm_unaligned_reloc.sh.log: arm_unaligned_reloc.sh @p='arm_unaligned_reloc.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +arm_farcall_arm_arm.sh.log: arm_farcall_arm_arm.sh + @p='arm_farcall_arm_arm.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +arm_farcall_arm_thumb.sh.log: arm_farcall_arm_thumb.sh + @p='arm_farcall_arm_thumb.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +arm_farcall_thumb_thumb.sh.log: arm_farcall_thumb_thumb.sh + @p='arm_farcall_thumb_thumb.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +arm_farcall_thumb_arm.sh.log: arm_farcall_thumb_arm.sh + @p='arm_farcall_thumb_arm.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) object_unittest.log: object_unittest$(EXEEXT) @p='object_unittest$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) binary_unittest.log: binary_unittest$(EXEEXT) @@ -5371,6 +5409,87 @@ uninstall-am: @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_unaligned_reloc.o: arm_unaligned_reloc.s @DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_arm_arm.stdout: arm_farcall_arm_arm +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -d $< > $@ + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_arm_arm: arm_farcall_arm_arm.o ../ld-new +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001020 -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_arm_arm.o: arm_farcall_arm_arm.s +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_arm_thumb.stdout: arm_farcall_arm_thumb +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -D $< > $@ + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_arm_thumb: arm_farcall_arm_thumb.o ../ld-new +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_arm_thumb.o: arm_farcall_arm_thumb.s +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_arm_thumb_5t.stdout: arm_farcall_arm_thumb_5t +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -D $< > $@ + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_arm_thumb_5t: arm_farcall_arm_thumb_5t.o ../ld-new +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_arm_thumb_5t.o: arm_farcall_arm_thumb.s +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -march=armv5t -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb.stdout: arm_farcall_thumb_thumb +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -D $< > $@ + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb: arm_farcall_thumb_thumb.o ../ld-new +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb.o: arm_farcall_thumb_thumb.s +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -march=armv4t -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb_5t.stdout: arm_farcall_thumb_thumb_5t +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -D $< > $@ + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb_5t: arm_farcall_thumb_thumb_5t.o ../ld-new +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb_5t.o: arm_farcall_thumb_thumb.s +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -march=armv5t -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb_7m.stdout: arm_farcall_thumb_thumb_7m +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -D $< > $@ + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb_7m: arm_farcall_thumb_thumb_7m.o ../ld-new +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb_7m.o: arm_farcall_thumb_thumb.s +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -march=armv7-m -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb_6m.stdout: arm_farcall_thumb_thumb_6m +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -D $< > $@ + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb_6m: arm_farcall_thumb_thumb_6m.o ../ld-new +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new --section-start .text=0x1000 --section-start .foo=0x2001014 -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_thumb_6m.o: arm_farcall_thumb_thumb.s +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -march=armv6-m -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_arm.stdout: arm_farcall_thumb_arm +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -D $< > $@ + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_arm: arm_farcall_thumb_arm.o ../ld-new +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_arm.o: arm_farcall_thumb_arm.s +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_arm_5t.stdout: arm_farcall_thumb_arm_5t +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_OBJDUMP) -D $< > $@ + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_arm_5t: arm_farcall_thumb_arm_5t.o ../ld-new +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ ../ld-new --section-start .text=0x1c01010 --section-start .foo=0x2001014 -o $@ $< + +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@arm_farcall_thumb_arm_5t.o: arm_farcall_thumb_arm.s +@DEFAULT_TARGET_ARM_TRUE@@NATIVE_OR_CROSS_LINKER_TRUE@ $(TEST_AS) -march=armv5t -o $@ $< + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/gold/testsuite/arm_farcall_arm_arm.s b/gold/testsuite/arm_farcall_arm_arm.s new file mode 100644 index 0000000..00c1e48 --- /dev/null +++ b/gold/testsuite/arm_farcall_arm_arm.s @@ -0,0 +1,20 @@ +@ Test to ensure that a ARM to ARM call exceeding 32Mb generates a stub. + + .global _start + .syntax unified + +@ We will place the section .text at 0x1000. + + .text + +_start: + bl bar + +@ We will place the section .foo at 0x2001020. + + .section .foo, "xa" + + .type bar, %function +bar: + bx lr + diff --git a/gold/testsuite/arm_farcall_arm_arm.sh b/gold/testsuite/arm_farcall_arm_arm.sh new file mode 100755 index 0000000..7d95528 --- /dev/null +++ b/gold/testsuite/arm_farcall_arm_arm.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# arm_farcall_arm_arm.sh -- a test case for ARM->ARM farcall veneers + +# Copyright 2010, 2011, Free Software Foundation, Inc. +# Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com> +# Based upon arm_cortex_a8.sh +# 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. + +check() +{ + if ! grep -q "$2" "$1" + then + echo "Did not find expected instruction in $1:" + echo " $2" + echo "" + echo "Actual instructions below:" + cat "$1" + exit 1 + fi +} + +# Check for ARM->ARM default +check arm_farcall_arm_arm.stdout "1004: .* ldr pc, \[pc, #-4\] .*" +check arm_farcall_arm_arm.stdout "1008: 02001020" + +exit 0 diff --git a/gold/testsuite/arm_farcall_arm_thumb.s b/gold/testsuite/arm_farcall_arm_thumb.s new file mode 100644 index 0000000..c69f31c --- /dev/null +++ b/gold/testsuite/arm_farcall_arm_thumb.s @@ -0,0 +1,20 @@ +@ Test to ensure that a ARM to Thumb call exceeding 32Mb generates a stub. + + .global _start + .global bar + .syntax unified + +@ We will place the section .text at 0x1000. + + .text + +_start: + bl bar + +@ We will place the section .foo at 0x2001010. + + .section .foo, "xa" + .thumb_func +bar: + bx lr + diff --git a/gold/testsuite/arm_farcall_arm_thumb.sh b/gold/testsuite/arm_farcall_arm_thumb.sh new file mode 100755 index 0000000..2df2d65 --- /dev/null +++ b/gold/testsuite/arm_farcall_arm_thumb.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +# arm_farcall_arm_thumb.sh -- a test case for ARM->Thumb farcall veneers. + +# Copyright 2010, 2011, Free Software Foundation, Inc. +# Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com> +# Based upon arm_cortex_a8.sh +# 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. + +check() +{ + if ! grep -q "$2" "$1" + then + echo "Did not find expected instruction in $1:" + echo " $2" + echo "" + echo "Actual instructions below:" + cat "$1" + exit 1 + fi +} + +# Check for ARM->Thumb default +check arm_farcall_arm_thumb.stdout "1004: .* ldr ip, \[pc\]" +check arm_farcall_arm_thumb.stdout "1008: .* bx ip" +check arm_farcall_arm_thumb.stdout "100c: 02001015" + +# Check for ARM->Thumb with v5t interworking +chck arm_farcall_arm_thumb_5t.stdout "1004: f004 e51f" +chck arm_farcall_arm_thumb_5t.stdout "1008: 1015" +chck arm_farcall_arm_thumb_5t.stdout "100a: 0200" + +exit 0 diff --git a/gold/testsuite/arm_farcall_thumb_arm.s b/gold/testsuite/arm_farcall_thumb_arm.s new file mode 100644 index 0000000..1fd6a07 --- /dev/null +++ b/gold/testsuite/arm_farcall_thumb_arm.s @@ -0,0 +1,27 @@ +@ Test to ensure that a Thumb to ARM call exceeding 4Mb generates a stub. +@ Check that we can generate two types of stub in the same section. + + .global _start + .syntax unified + +@ We will place the section .text at 0x1c01010. + + .text + .thumb_func +_start: + .global bar + bl bar +@ This call is close enough to generate a "short branch" stub +@ or no stub if blx is available. + .space 0x0300000 + bl bar + +@ We will place the section .foo at 0x2001014. + + .section .foo, "xa" + + .arm + .type bar, %function +bar: + bx lr + diff --git a/gold/testsuite/arm_farcall_thumb_arm.sh b/gold/testsuite/arm_farcall_thumb_arm.sh new file mode 100755 index 0000000..e22da46 --- /dev/null +++ b/gold/testsuite/arm_farcall_thumb_arm.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +# arm_farcall_thumb_arm.sh -- a test case for Thumb->ARM farcall veneers. + +# Copyright 2010, 2011, Free Software Foundation, Inc. +# Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com> +# Based upon arm_cortex_a8.sh +# 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. + +check() +{ + if ! grep -q "$2" "$1" + then + echo "Did not find expected instruction in $1:" + echo " $2" + echo "" + echo "Actual instructions below:" + cat "$1" + exit 1 + fi +} + +# Thumb->ARM +check arm_farcall_thumb_arm.stdout "1f01018: .* bx pc" +check arm_farcall_thumb_arm.stdout "1f0101a: .* nop" +check arm_farcall_thumb_arm.stdout "1f0101c: f004 e51f" +check arm_farcall_thumb_arm.stdout "1f01020: 1014" +check arm_farcall_thumb_arm.stdout "1f01022: 0200" + +check arm_farcall_thumb_arm.stdout "1f01024: .* bx pc" +check arm_farcall_thumb_arm.stdout "1f01026: .* nop" +check arm_farcall_thumb_arm.stdout "1f01028: fff9 ea03" + +# Thumb->ARM with v5T interworking +check arm_farcall_thumb_arm_5t.stdout "1f01018: f004 e51f" +check arm_farcall_thumb_arm_5t.stdout "1f0101c: 1014" +check arm_farcall_thumb_arm_5t.stdout "1f0101e: 0200" + +exit 0 diff --git a/gold/testsuite/arm_farcall_thumb_thumb.s b/gold/testsuite/arm_farcall_thumb_thumb.s new file mode 100644 index 0000000..650b1a6 --- /dev/null +++ b/gold/testsuite/arm_farcall_thumb_thumb.s @@ -0,0 +1,19 @@ +@ Test to ensure that a Thumb to Thumb call exceeding 4Mb generates a stub. + + .global _start + .syntax unified + +@ We will place the section .text at 0x1000. + + .text + .thumb_func +_start: + bl bar + +@ We will place the section .foo at 0x02001014. + + .section .foo, "xa" + .thumb_func +bar: + bx lr + diff --git a/gold/testsuite/arm_farcall_thumb_thumb.sh b/gold/testsuite/arm_farcall_thumb_thumb.sh new file mode 100755 index 0000000..23fb0cd --- /dev/null +++ b/gold/testsuite/arm_farcall_thumb_thumb.sh @@ -0,0 +1,74 @@ +#!/bin/sh + +# arm_farcall_thumb_thumb.sh -- a test case for Thumb->Thumb farcall veneers. + +# Copyright 2010, 2011, Free Software Foundation, Inc. +# Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com> +# Based upon arm_cortex_a8.sh +# 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. + +check() +{ + if ! grep -q "$2" "$1" + then + echo "Did not find expected instruction in $1:" + echo " $2" + echo "" + echo "Actual instructions below:" + cat "$1" + exit 1 + fi +} + +# Thumb->Thumb default +check arm_farcall_thumb_thumb.stdout "1004: .* bx pc" +check arm_farcall_thumb_thumb.stdout "1006: .* nop" +check arm_farcall_thumb_thumb.stdout "1008: c000" +check arm_farcall_thumb_thumb.stdout "100a: e59f" +check arm_farcall_thumb_thumb.stdout "100c: ff1c e12f" +check arm_farcall_thumb_thumb.stdout "1010: 1015" +check arm_farcall_thumb_thumb.stdout "1012: 0200" + +# Thumb->Thumb with v5T interworking +check arm_farcall_thumb_thumb_5t.stdout "1004: f004 e51f" +check arm_farcall_thumb_thumb_5t.stdout "1008: 1015" +check arm_farcall_thumb_thumb_5t.stdout "100a: 0200" + +# Thumb->Thumb on v6-M +check arm_farcall_thumb_thumb_6m.stdout "1004: .* push {r0}" +check arm_farcall_thumb_thumb_6m.stdout "1006: .* ldr r0, \\[pc, #8\\]" +check arm_farcall_thumb_thumb_6m.stdout "1008: .* mov ip, r0" +check arm_farcall_thumb_thumb_6m.stdout "100a: .* pop {r0}" +check arm_farcall_thumb_thumb_6m.stdout "100c: .* bx ip" +check arm_farcall_thumb_thumb_6m.stdout "100e: .* nop" +check arm_farcall_thumb_thumb_6m.stdout "1010: 1015" +check arm_farcall_thumb_thumb_6m.stdout "1012: 0200" + +# Thumb->Thumb on v7-M +check arm_farcall_thumb_thumb_6m.stdout "1004: .* push {r0}" +check arm_farcall_thumb_thumb_6m.stdout "1006: .* ldr r0, \\[pc, #8\\]" +check arm_farcall_thumb_thumb_6m.stdout "1008: .* mov ip, r0" +check arm_farcall_thumb_thumb_6m.stdout "100a: .* pop {r0}" +check arm_farcall_thumb_thumb_6m.stdout "100c: .* bx ip" +check arm_farcall_thumb_thumb_6m.stdout "100e: .* nop" +check arm_farcall_thumb_thumb_6m.stdout "1010: 1015" +check arm_farcall_thumb_thumb_6m.stdout "1012: 0200" + +exit 0 |