Skip to content

Conversation

@JarmouniA
Copy link
Contributor

Backport d7d3ae5 from #92569.

Fixes #90777

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)
@JarmouniA JarmouniA added the Backport Backport PR and backport failure issues label Jul 14, 2025
@github-project-automation github-project-automation bot moved this to To do in Backports Jul 14, 2025
@JarmouniA JarmouniA linked an issue Jul 14, 2025 that may be closed by this pull request
@sonarqubecloud
Copy link

@JarmouniA JarmouniA marked this pull request as ready for review July 14, 2025 21:42
@github-actions github-actions bot added the area: ARM ARM (32-bit) Architecture label Jul 14, 2025
@aescolar aescolar merged commit 9405eaf into v3.7-branch Aug 11, 2025
28 checks passed
@github-project-automation github-project-automation bot moved this from To do to Done in Backports Aug 11, 2025
@aescolar aescolar deleted the backport-92569-to-v3.7-branch branch August 11, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ARM ARM (32-bit) Architecture Backport Backport PR and backport failure issues

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Backport v3.7-branch] Failed to backport #92569

7 participants