bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ld: Neither "FILL(x);" nor "{ }>Memory = x" allow symbols


From: Alan Modra
Subject: Re: ld: Neither "FILL(x);" nor "{ }>Memory = x" allow symbols
Date: Tue, 28 Jan 2020 10:12:52 +1030
User-agent: Mutt/1.9.4 (2018-02-28)

On Fri, Jan 24, 2020 at 03:34:45PM +1100, address@hidden 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]