This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld: Neither "FILL(x);" nor "{ }>Memory = x" allow symbols
- From: Alan Modra <amodra at gmail dot com>
- To: John dot Adriaan at BigPond dot com
- Cc: Bug-BinUtils at GNU dot org, binutils at sourceware dot org
- Date: Tue, 28 Jan 2020 10:12:52 +1030
- Subject: Re: ld: Neither "FILL(x);" nor "{ }>Memory = x" allow symbols
- References: <01ba01d5d26f$9b37dcf0$d1a796d0$@BigPond.com>
On Fri, Jan 24, 2020 at 03:34:45PM +1100, John.Adriaan@BigPond.com wrote:
[on trying to use a symbol in a fill expression]
> arm-none-eabi/bin/ld.exe: bfd_link_hash_lookup failed: no error (It's the
> "no error" part that I like the most!)
Yes, that is silly. I'm going to commit the following to fix that.
* ldexp.c (fold_name): Don't print bfd_link_hash_lookup failed
in first phase.
diff --git a/ld/ldexp.c b/ld/ldexp.c
index 1fda65d714..6d1457b929 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -730,7 +730,10 @@ fold_name (etree_type *tree)
tree->name.name,
TRUE, FALSE, TRUE);
if (!h)
- einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
+ {
+ if (expld.phase != lang_first_phase_enum)
+ einfo (_("%F%P: bfd_link_hash_lookup failed: %E\n"));
+ }
else if (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak)
{
> It seems like the Fill algorithm doesn't like to use symbols.
Right. The fill expression is evaluated when parsing the script for
the first time, before the symbol table is even created.
--
Alan Modra
Australia Development Lab, IBM