From: Alan Modra Date: Thu, 26 Aug 2021 02:49:35 +0000 (+0930) Subject: PR28264, ld.bfd crash on linking efivar with LTO X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b05929a20efa7caa40415d2f069e44f7e76615e4;p=binutils-gdb.git 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. --- 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: