Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Nov 11, 2023
1 parent 8131528 commit b59911b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions elf/input-files.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1290,17 +1290,17 @@ void SharedFile<E>::parse(Context<E> &ctx) {
continue;

std::string_view name = this->symbol_strtab.data() + esyms[i].st_name;
bool is_hidden = (!vers.empty() && (vers[i] & VERSYM_HIDDEN));
bool is_default = vers.empty() || !(vers[i] & VERSYM_HIDDEN);

this->elf_syms2.push_back(esyms[i]);
this->versyms.push_back(ver);

if (is_hidden) {
if (is_default) {
this->symbols.push_back(get_symbol(ctx, name));
} else {
std::string_view mangled_name = save_string(
ctx, std::string(name) + "@" + std::string(version_strings[ver]));
this->symbols.push_back(get_symbol(ctx, mangled_name, name));
} else {
this->symbols.push_back(get_symbol(ctx, name));
}
}

Expand Down

0 comments on commit b59911b

Please sign in to comment.