I have an application targeting ARM Cortex M0+ MCU, written primarily in C++ but using a FPU library written in assembler. For performance reasons I need to run these functions in RAM, which means that when functions in flash memory call them it is necessary to use a farcall stub because the usual BL instruction can’t cover the address difference between flash and RAM. For calls to code compiled from C++ but assigned to RAM, the linker generates these stubs automatically. But for calls to the functions in my assembler file, it doesn’t.
I have read that “Farcalls stubs insertion is fully supported for the ARM-EABI target only, because it relies on object files properties not present otherwise.”. I’ve also discovered that the GNU assembler has a directive “.eabi_attribute” so my guess is that I need to use this directive in my assembler file somehow to enable the linker to generate farcall stubs to its function entry points when necessary. But I’ve found no guidance on what attributes to specify.
Can anyone help me to get this working? My assembler file already has “.cpu cortex-m0plus” and “.thumb” directives near the start.