From 738174e17e539937a6d773d7dfd501241a882b0b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 28 Jan 2020 10:07:46 +1030 Subject: [PATCH] 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. --- ld/ChangeLog | 5 +++++ ld/ldexp.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index fe87678b85d..7a1dc98bca1 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2020-01-28 Alan Modra + + * ldexp.c (fold_name): Don't print bfd_link_hash_lookup failed + in first phase. + 2020-01-27 Alan Modra * testsuite/ld-elfvers/vers.exp: Replace case statements with diff --git a/ld/ldexp.c b/ld/ldexp.c index 1fda65d7148..6d1457b929a 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) { -- 2.30.2