From b05929a20efa7caa40415d2f069e44f7e76615e4 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 26 Aug 2021 12:19:35 +0930 Subject: [PATCH] PR28264, ld.bfd crash on linking efivar with LTO PR 28264 PR 26978 * linker.c (_bfd_generic_link_add_one_symbol ): Check that string is non-NULL. --- bfd/linker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/linker.c b/bfd/linker.c index 755ff19923b..f8257ea11b4 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -1682,7 +1682,7 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info, cycle = true; break; } - if (strcmp (h->u.i.link->root.string, string) == 0) + if (string != NULL && strcmp (h->u.i.link->root.string, string) == 0) break; /* Fall through. */ case MDEF: -- 2.30.2