diff --git a/object_file.cc b/object_file.cc index 4c956cea..906eb585 100644 --- a/object_file.cc +++ b/object_file.cc @@ -878,13 +878,14 @@ void SharedFile::parse() { continue; std::string_view name = symbol_strtab.data() + esyms[i].st_name; + Symbol *sym = Symbol::intern(name); if (esyms[i].is_defined()) { elf_syms.push_back(&esyms[i]); versyms.push_back(vers.empty() ? 1 : vers[i]); - symbols.push_back(Symbol::intern(name)); + symbols.push_back(sym); } else { - undefs.push_back(Symbol::intern(name)); + undefs.push_back(sym); } }