* [binutils-gdb] Error: attempt to get value of unresolved symbol `L0'
@ 2022-10-11 10:53 Nick Clifton
0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2022-10-11 10:53 UTC (permalink / raw)
To: bfd-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=029b1ee8d8805ba8cbc4481c107c8e5f32b48eab
commit 029b1ee8d8805ba8cbc4481c107c8e5f32b48eab
Author: Nick Clifton <nickc@redhat.com>
Date: Tue Oct 11 11:52:38 2022 +0100
Error: attempt to get value of unresolved symbol `L0'
* symbols.c (S_GET_VALUE): If the unresolved symbol is the fake
label provide a more helpful error message to the user.
Diff:
---
gas/ChangeLog | 5 +++++
gas/symbols.c | 9 +++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 018ce60e9ce..ce4e78cd92f 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2022-10-11 Nick Clifton <nickc@redhat.com>
+
+ * 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 <nickc@redhat.com>
PR 29623
diff --git a/gas/symbols.c b/gas/symbols.c
index d4c0dff7ad6..0aac3a434f2 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-11 10:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11 10:53 [binutils-gdb] Error: attempt to get value of unresolved symbol `L0' Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).