extinguish opened a new pull request, #17863:
URL: https://github.com/apache/nuttx/pull/17863

   ## Summary
   
   when we build with greenhills compiler, if the exception_common function is 
put into a separate section: ".text.exception_common", then the address of 
exception_common function is an even number, for example "0x16a6c", in this 
case, it will trigger the UsageFaults:INVSTATE error. The reason for this error 
is that in the GHS compiler, a section declared through the ".section" 
directive must specify at least the "a" attribute. Otherwise, this section will 
not be linked into the final file, and this is why the address of 
exception_common function is invalid. The following is the official explanation 
in the GHS compiler documentation: "The reason for this error is that in the 
GHS compiler, a section declared through the .section directive must specify at 
least the "a" attribute. Otherwise, this section will not be linked into the 
final file. The following is the official explanation in the documentation: 
"Sections that are intended be part of the final linked output should have at 
lea
 st the `a` attribute"
   and for GHS compiler, the .text section is recommended specify the attribute 
of `ax`.
   
   ## Impact
   
   1. Fixes runtime UsageFault:INVSTATE errors when using the Green Hills 
toolchain on ARMv7-M targets.
   2. No impact on other toolchains (GCC, Clang, etc.)—the added attributes are 
compatible with standard ARM assembly syntax.
   
   ## Testing
   
   Verified that builds with Green Hills compiler no longer produce 
UsageFault:INVSTATE errors during exception handling.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to