From c820be077e039666a0dec7a4d95668fb46d0a375 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 26 Aug 2008 11:46:41 +0000 Subject: bfd/ * elf32-arm.c (arm_thumb_arm_v4t_short_branch_stub): Define. (elf32_arm_stub_type): Add arm_thumb_arm_v4t_stub_short_branch. (arm_type_of_stub): Handle armv4t short branches. Update prototype. (arm_stub_is_thumb): Handle arm_thumb_arm_v4t_stub_short_branch. (arm_build_one_stub): Likewise. (arm_size_one_stub): Likewise. (elf32_arm_size_stubs): Use new arm_type_of_stub prototype. (arm_map_one_stub): Handle arm_thumb_arm_v4t_stub_short_branch. ld/testsuite/ * ld-arm/arm-elf.exp: Add farcall-thumb-arm-short test. * ld-arm/farcall-group2.s: Fix comment. * ld-arm/farcall-thumb-arm-short.d: New test. * ld-arm/farcall-thumb-arm-short.s: New test. --- ld/testsuite/ld-arm/arm-elf.exp | 5 ++++- ld/testsuite/ld-arm/farcall-group2.s | 5 +---- ld/testsuite/ld-arm/farcall-thumb-arm-short.d | 14 ++++++++++++++ ld/testsuite/ld-arm/farcall-thumb-arm-short.s | 21 +++++++++++++++++++++ 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 ld/testsuite/ld-arm/farcall-thumb-arm-short.d create mode 100644 ld/testsuite/ld-arm/farcall-thumb-arm-short.s (limited to 'ld/testsuite/ld-arm') diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index c01c795cb2..6075e68d35 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -207,7 +207,7 @@ set armeabitests { {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" {thumb2-bl.s} {{objdump -dr thumb2-bl.d}} "thumb2-bl"} - + {"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "--fix-v4bx -meabi=4" {armv4-bx.s} {{objdump -d armv4-bx.d}} "armv4-bx"} @@ -260,6 +260,9 @@ set armeabitests { {"Thumb-ARM farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "-W" {farcall-thumb-arm.s} {{objdump -d farcall-thumb-arm.d}} "farcall-thumb-arm"} + {"Thumb-ARM (short) call" "-Ttext 0x1000 --section-start .foo=0x0002014" "-W" {farcall-thumb-arm-short.s} + {{objdump -d farcall-thumb-arm-short.d}} + "farcall-thumb-arm-short"} {"Thumb-ARM farcall with BLX" "-Ttext 0x1000 --section-start .foo=0x2001014" "-W -march=armv5t" {farcall-thumb-arm.s} {{objdump -d farcall-thumb-arm-blx.d}} "farcall-thumb-arm-blx"} diff --git a/ld/testsuite/ld-arm/farcall-group2.s b/ld/testsuite/ld-arm/farcall-group2.s index 4624804919..774869f938 100644 --- a/ld/testsuite/ld-arm/farcall-group2.s +++ b/ld/testsuite/ld-arm/farcall-group2.s @@ -1,10 +1,7 @@ - @ Test to ensure that ARM calls exceeding 32Mb generate stubs. -@ We will place the section .foo at 0x2000. - .text -myfunc: +myfunc: bl bar3 bl bar4 bl bar5 diff --git a/ld/testsuite/ld-arm/farcall-thumb-arm-short.d b/ld/testsuite/ld-arm/farcall-thumb-arm-short.d new file mode 100644 index 0000000000..2e7a17a3c1 --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-thumb-arm-short.d @@ -0,0 +1,14 @@ +.*: file format .* + +Disassembly of section .text: + +00001000 <__bar_from_thumb>: + 1000: 4778 bx pc + 1002: 46c0 nop \(mov r8, r8\) + 1004: ea000402 b 2014 +00001008 <_start>: + 1008: f7ff fffa bl 1000 <__bar_from_thumb> +Disassembly of section .foo: + +00002014 : + 2014: e12fff1e bx lr diff --git a/ld/testsuite/ld-arm/farcall-thumb-arm-short.s b/ld/testsuite/ld-arm/farcall-thumb-arm-short.s new file mode 100644 index 0000000000..186538098b --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-thumb-arm-short.s @@ -0,0 +1,21 @@ +@ Test to ensure that a Thumb to ARM call within 4Mb does not generate 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 0x2014. + + .section .foo, "xa" + + .arm + .type bar, %function +bar: + bx lr + -- cgit v1.2.1