ARMv8-M.Main using limited thumb long calls

Bug #1884790 reported by Andrew Malachowski on 2020-06-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Undecided
Unassigned

Bug Description

The Tag_THUMB_ISA_use version was bumped from 2 to 3 for ARMv8-M. This causes the using_thumb2 function in elf32-arm.c to mischaracterize THUMB2 support for ARMv8-M Main which is used for the long call stub selection, resulting in the limited thumb variant being used instead of the optimized Thumb2 variant. e.g.

-march=armv8-m.main
    000000b4 <main>:
      b4: b508 push {r3, r14}
      b6: f000 f96b bl 390 <__func0_veneer>
      ba: 2000 movs r0, #0
      bc: bd08 pop {r3, r15}
      be: bf00 nop

    00000390 <__func0_veneer>:
      390: b401 push {r0}
      392: 4802 ldr r0, [pc, #8] ; (39c <__func0_veneer+0xc>)
      394: 4684 mov r12, r0
      396: bc01 pop {r0}
      398: 4760 bx r12
      39a: bf00 nop
      39c: 18000001 .word 0x18000001

Comparatively on the CM4 using full THUMB2

-march-armv7e-m
    000000b4 <main>:
      b4: b508 push {r3, r14}
      b6: f000 f96b bl 390 <__func0_veneer>
      ba: 2000 movs r0, #0
      bc: bd08 pop {r3, r15}
      be: bf00 nop

    00000390 <__func0_veneer>:
     390: f85f f000 ldr.w r15, [r15] ; 394 <__func0_veneer+0x4>
     394: 18000001 .word 0x18000001

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions