btashton commented on issue #3737:
URL: 
https://github.com/apache/incubator-nuttx/issues/3737#issuecomment-846675985


   Ok I think I have tracked the issue down.  Apparently we have not been using 
the correct way of determining if the branch type is thumb or not, and should 
not be relying on  `STT_ARM_TFUNC`.  There were new macros added in 2016 for 
accessing this information:
   
   ```
   #define NUM_ENUM_ARM_ST_BRANCH_TYPE_BITS 2
   #define ENUM_ARM_ST_BRANCH_TYPE_BITMASK      \
     ((1 << NUM_ENUM_ARM_ST_BRANCH_TYPE_BITS) - 1)
   
   #define ARM_GET_SYM_BRANCH_TYPE(STI) \
     ((enum arm_st_branch_type) ((STI) & ENUM_ARM_ST_BRANCH_TYPE_BITMASK))
   
          is_thumb =
            ((ARM_GET_SYM_BRANCH_TYPE (isym->st_target_internal)
              == ST_BRANCH_TO_THUMB) || type == STT_ARM_16BIT);
   ```
   
   vs
   
   ```
   ((isym->st_info & 0x0f) == STT_ARM_TFUNC || (isym->st_info & 0x0f) == 
STT_ARM_16BIT)
   ```
   
   I will clean this up and provide a patch.


-- 
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.

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


Reply via email to