summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-01-28 10:07:46 +1030
committerAlan Modra <amodra@gmail.com>2020-01-29 11:15:16 +1030
commitfbcb30f2c1b26cd972abed8d9cd8a6a2de4c5cc4 (patch)
treeb016974580de8e135564ab1316f90fef328e1c44
parent7b647b69680015f240b20e6f38d824d71d4bd30d (diff)
Don't report symbol lookup failure in first phase of linking
Until the symbol table is created, symbols can't be created. * ldexp.c (fold_name): Don't print bfd_link_hash_lookup failed in first phase. (cherry picked from commit 738174e17e539937a6d773d7dfd501241a882b0b)
-rw-r--r--ld/ChangeLog4
-rw-r--r--ld/ldexp.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 25878f9234..bcafc947a8 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,6 +1,10 @@
2020-01-29 Alan Modra <amodra@gmail.com>
Apply from master
+ 2020-01-28 Alan Modra <amodra@gmail.com>
+ * ldexp.c (fold_name): Don't print bfd_link_hash_lookup failed
+ in first phase.
+
2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
Alan Modra <amodra@gmail.com>
PR ld/25458
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)
{