Skip to content

[Relocator] Show referenced symbol in overflow diagnostics - #1617

Open
quic-areg wants to merge 1 commit into
qualcomm:mainfrom
quic-areg:overflow-diag
Open

[Relocator] Show referenced symbol in overflow diagnostics#1617
quic-areg wants to merge 1 commit into
qualcomm:mainfrom
quic-areg:overflow-diag

Conversation

@quic-areg

@quic-areg quic-areg commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Extend the relocation overflow error diagnostic to show the path and
name for the referenced symbol:

references ('sym') for an object-defined symbol
references <script>:('sym') for a linker script assignment or PROVIDE
references '--defsym sym' for a --defsym symbol
references linker internal symbol 'sym' for an internal symbol

Undefined and section symbols keep the old references 'sym' form.

Fixes #755

Comment thread include/eld/Diagnostics/DiagRelocations.inc Outdated
Comment thread test/RISCV/standalone/JAL/JALOverflowDefinedIn.s Outdated

@parth-07 Parth (parth-07) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but it seems that some tests need to be updated to use the new diagnostic format.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of your changes look great, but I would like this change to be split into smaller pieces.

For this update, we only need the bare minimum required to show the input file. Any additional diagnostic enhancements can be submitted separately as follow-on improvements.

Also, please keep in mind that this change will need to be cherry-picked to 23.x as well. For 23.x we just need the bare minimum.

Comment thread include/eld/Input/Input.h Outdated
/// True for the synthetic script input created for a --defsym assignment.
void setIsDefSym() { IsDefSym = true; }

bool isDefSym() const { return IsDefSym; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in a seperate commit.

Comment thread lib/Script/ScriptCommand.cpp Outdated
std::string ScriptCommand::getContextWithLineNumber() const {
return getContext() + (hasLineNumberInContext()
? ":" + std::to_string(getLineNumberInContext())
: "");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should seperate this to a seperate commit.

@quic-areg quic-areg added the zephyr-check Run Zephyr build/check workflow on this PR label Aug 6, 2026
@quic-areg
quic-areg force-pushed the overflow-diag branch 2 times, most recently from 288160f to 5839073 Compare August 7, 2026 18:18
Extend the relocation overflow error diagnostic to show the path and
name for the referenced symbol.

Fixes qualcomm#755

Signed-off-by: quic-areg <aregmi@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

zephyr-check Run Zephyr build/check workflow on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve overflow diagnostics to show input file for destination symbol

3 participants