Hi,Query:
Is there a way to generate object code that avoids using unprivileged instructions - `ldrbt`, `ldrsht`, `ldrt` - using ARMCLANG compiler (version 6.16) ?Some light on how the compiler chooses to generate one of the two variants (privileged / unprivileged ) instructions for a given code would also be helpful.
ldrbt`, `ldrsht`, `ldrt
Background:
We have a specific case where we see that an application using a library built using ARMCLANG for Cortex-M55 is crashing on our test board.
On debugging the root cause for the crash, we see that the crash is happening at a unprivileged access (ldrbt, ldrsht, ldrt) ARM instruction.The same library(source) from GCC build works perfectly fine.We have another observation with ARMCLANG build.When we break the build steps: a particular C source file is converted to assembly first (using ARMCLANG again) and converted to object code later, the resulting library build does not have unprivileged access instructions and works without any crash.TL;DR - Same source compiled with GCC build works fine whereas ARMCLANG build produces a crash - suspecting unprivileged access ARM instructions to be root cause. Any suggestions on avoiding such instructions in build is highly appreciated.Thanks!
ldrbt, ldrsht, ldrt
Hello, I am Ronan, from Arm.
I've found some instances of this occurring, but we believe we have addressed them.
Is it possible for you to use an updated toolchain? The latest version of Arm Compiler is 6.22 (also provided in later tools suites such as Keil MDK or Arm Development Studio).
https://developer.arm.com/Tools%20and%20Software/Arm%20Compiler%20for%20Embedded
Regards, Ronan