Skip to content

Commit

Permalink
Error: attempt to get value of unresolved symbol `L0'
Browse files Browse the repository at this point in the history
	* symbols.c (S_GET_VALUE): If the unresolved symbol is the fake
	label provide a more helpful error message to the user.
  • Loading branch information
nickclifton committed Oct 11, 2022
1 parent d2d6905 commit 029b1ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions gas/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2022-10-11 Nick Clifton <[email protected]>

* symbols.c (S_GET_VALUE): If the unresolved symbol is the fake
label provide a more helpful error message to the user.

2022-09-28 Nick Clifton <[email protected]>

PR 29623
Expand Down
9 changes: 7 additions & 2 deletions gas/symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -2236,8 +2236,13 @@ S_GET_VALUE (symbolS *s)
if (! s->flags.resolved
|| s->x->value.X_op != O_symbol
|| (S_IS_DEFINED (s) && ! S_IS_COMMON (s)))
as_bad (_("attempt to get value of unresolved symbol `%s'"),
S_GET_NAME (s));
{
if (strcmp (S_GET_NAME (s), FAKE_LABEL_NAME) == 0)
as_bad (_("expression is too complex to be resolved"));
else
as_bad (_("attempt to get value of unresolved symbol `%s'"),
S_GET_NAME (s));
}
}
return (valueT) s->x->value.X_add_number;
}
Expand Down

0 comments on commit 029b1ee

Please sign in to comment.