From 43d9536a05367941c2714179b1909fcb2edb0180 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Mon, 5 Aug 2024 20:06:44 +0900 Subject: [PATCH] Fix an assertion failure https://github.com/rui314/mold/issues/573 --- elf/passes.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elf/passes.cc b/elf/passes.cc index 3eea8baab5..477fdc476c 100644 --- a/elf/passes.cc +++ b/elf/passes.cc @@ -974,7 +974,7 @@ R"(# This is an output of the mold linker's --print-dependencies option. std::unordered_set visited; for (const ElfRel &r : isec->get_rels(ctx)) { - if (r.r_type == R_NONE) + if (r.r_type == R_NONE || file->elf_syms.size() <= r.r_sym) continue; ElfSym &esym = file->elf_syms[r.r_sym];