- nlist.n_value += ANOFFSET (objfile->section_offsets,
- data_sect_index);
-
- if (gdbarch_static_transform_name_p (gdbarch))
- gdbarch_static_transform_name (gdbarch, namestring);
-
- add_psymbol_to_list (sym_name, sym_len, 1,
- VAR_DOMAIN, LOC_STATIC,
- &objfile->static_psymbols,
- nlist.n_value, psymtab_language, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
+ VAR_DOMAIN, LOC_STATIC,
+ data_sect_index,
+ psymbol_placement::STATIC,
+ nlist.n_value, psymtab_language,
+ partial_symtabs, objfile);
+ else
+ complaint (_("static `%*s' appears to be defined "
+ "outside of all compilation units"),
+ sym_len, sym_name);