Commit f02a5f4
arch: arm: cortex_m: Force literal pool placement in inline asm block
When LTO is enabled, linker may relocate literal pools out of Thumb LDR
instruction's reach causing "offset out of range" errors while linking.
This commit adds `.ltorg` directive in the inline asm blocks where absolute
addresses are loaded using the `ldr` instructions, in order to ensure that
the literal pool containing the absolute addresses are placed near the
`ldr` instructions.
Note that the `.ltorg` directive is recognised by all toolchains supported
by Zephyr and no toolchain abstraction is provided for now.
Signed-off-by: Stephanos Ioannidis <[email protected]>
(cherry picked from commit d7d3ae5)1 parent 4ebecae commit f02a5f4
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
| 589 | + | |
| 590 | + | |
589 | 591 | | |
590 | 592 | | |
591 | 593 | | |
| |||
653 | 655 | | |
654 | 656 | | |
655 | 657 | | |
| 658 | + | |
| 659 | + | |
656 | 660 | | |
657 | 661 | | |
658 | 662 | | |
| |||
0 commit comments