https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115360

            Bug ID: 115360
           Summary: cmse_nonsecure_call wrapper missing STT_FUNCTION
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: avieira at gcc dot gnu.org
  Target Milestone: ---

The Arm ABI requires a linker to handle calls to 'distant' functions by
inserting a wrapper veneer, or trampoline.  Such functions need to be given
permission to do this by marking them as type STT_FUNC (so that it is clear
that there is a scratch register available for use within the veneer). 
Unfortunately, __gnu_cmse_nonesecure_call is not marked at all (defaulting to
STT_NOTYPE).  A separate bug in GNU ld means this problem is not diagnosed at
link time, and the linker silently picks the wrong veneer type into the
bargain, leading to run-time crashes when the CPU is asked to switch into Arm
state on a thumb-only processor.

Reply via email to