armv8-m.main long call implementation

Asked by Andrew Malachowski

I've noticed on gcc8 and gcc9 builds targeting the CM33 that the implementation of the veneers used for long calls appear to be using the limited THUMB2 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

Question information

Language:
English Edit question
Status:
Expired
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Andrew Malachowski (andrew-malachowski) said :
#2

It appears that this may be a bug in binutils. 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.

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.