Skip to content

Make ASM safer for thumb/cortex-m#29

Open
satur9nine wants to merge 1 commit intoedubart:mainfrom
satur9nine:thumb_safe
Open

Make ASM safer for thumb/cortex-m#29
satur9nine wants to merge 1 commit intoedubart:mainfrom
satur9nine:thumb_safe

Conversation

@satur9nine
Copy link

  • Explicit .thumb/.thumb_func ensures the code is assembled and tagged as Thumb. Cortex‑M7 has no ARM state; without this you can get assembler errors or a HardFault if a call lands on an address without the Thumb bit set.
  • .syntax unified and the corrected .type syntax improve compatibility with modern assemblers (GAS/clang‑as) that may reject the original #function form
  • ldmia ..., pc is replaced with an explicit bx lr, which is the safer/clearer return sequence in Thumb and avoids any assembler restrictions around loading pc from a non‑SP base register.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant