Skip to content

Fix: Emit diagnostic when LMA is unaligned#1088

Open
shauryarane05 wants to merge 2 commits into
qualcomm:mainfrom
shauryarane05:fix-issue-444-lma-unaligned-diagnostic
Open

Fix: Emit diagnostic when LMA is unaligned#1088
shauryarane05 wants to merge 2 commits into
qualcomm:mainfrom
shauryarane05:fix-issue-444-lma-unaligned-diagnostic

Conversation

@shauryarane05
Copy link
Copy Markdown

Currently eld does not warn when a section's load memory address (LMA) is not a multiple of its alignment, like when AT() specifies an unaligned address.Added a warning in GNULDBackend::postLayout() to catch when the LMA isn’t properly aligned , mirroring the existing VMA-alignment check added in e09c562.

Fixes #444

@shauryarane05 shauryarane05 force-pushed the fix-issue-444-lma-unaligned-diagnostic branch from 670594b to a4c040e Compare April 22, 2026 12:04
@shauryarane05
Copy link
Copy Markdown
Author

fixed a clang-format issue flagged by CI (cosmetic line-break only, no logic change)

Comment thread test/Common/standalone/linkerscript/LMAUnaligned/Inputs/1.c Outdated
Comment thread test/Common/standalone/linkerscript/LMAUnaligned/LMAUnaligned.test Outdated
Comment thread lib/Target/GNULDBackend.cpp Outdated
@quic-areg quic-areg requested a review from parth-07 April 23, 2026 19:50
Currently eld does not warn when a section's load memory address (LMA)
is not a multiple of its alignment, e.g. when AT() specifies an
unaligned address. Emit the warn_lma_not_aligned warning in
GNULDBackend::postLayout(), mirroring the existing VMA-alignment check
added in e09c562.

Fixes qualcomm#444

Signed-off-by: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
@shauryarane05 shauryarane05 force-pushed the fix-issue-444-lma-unaligned-diagnostic branch from a4c040e to 52e9aa9 Compare April 24, 2026 16:22
@shauryarane05
Copy link
Copy Markdown
Author

Does this need changes or can it be merged?

@quic-areg quic-areg self-requested a review May 7, 2026 18:34
@quic-seaswara
Copy link
Copy Markdown
Contributor

@shauryarane05 can you resolve the conflicts and update the PR ?

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.

eld should emit a diagnostic when LMA is unaligned

3 participants