Skip to content

Commit

Permalink
Add more log
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzijian629 committed Jul 19, 2023
1 parent 387d5cd commit 555d98c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion symtab_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ void SymtabBuilder::SetSrcSyms(std::vector<Syminfo> syms) {
// unique symbols therefore found == src_syms_.end() is true always.
if (found == src_syms_.end() || found->second.second == NULL || !IsDefined(*found->second.second)) {
src_syms_[{s.name, s.soname, s.version}] = {s.versym, s.sym};
LOG(INFO) << "SymtabBuilder set src_syms_:" << SOLD_LOG_KEY(s.name) << SOLD_LOG_KEY(s.soname) << SOLD_LOG_KEY(s.version)
<< SOLD_LOG_KEY(s.versym);
}

auto found_fallback = src_fallback_syms_.find(s.name);
if ((s.versym & VERSYM_HIDDEN) == 0 && (found_fallback == src_fallback_syms_.end() || found_fallback->second.second == NULL ||
!IsDefined(*found_fallback->second.second))) {
src_fallback_syms_[s.name] = {s.versym, s.sym};
LOG(INFO) << "SymtabBuilder set src_fallback_syms_:" << SOLD_LOG_KEY(s.name) << SOLD_LOG_KEY(s.soname)
<< SOLD_LOG_KEY(s.version) << SOLD_LOG_KEY(s.versym);
}
}
}
Expand Down Expand Up @@ -85,12 +89,15 @@ bool SymtabBuilder::Resolve(const std::string& name, const std::string& soname,
if (found != src_syms_.end()) {
versym = found->second.first;
symp = found->second.second;
LOG(INFO) << "Found src_syms_:" << SOLD_LOG_KEY(name) << SOLD_LOG_KEY(soname) << SOLD_LOG_KEY(version)
<< ", resolved version:" << SOLD_LOG_KEY(versym);
} else {
auto found_fallback = src_fallback_syms_.find(name);
if (found_fallback != src_fallback_syms_.end()) {
LOG(INFO) << "Use fallback version of " << name;
versym = found_fallback->second.first;
symp = found_fallback->second.second;
LOG(INFO) << "Use fallback version: " << SOLD_LOG_KEY(name) << SOLD_LOG_KEY(soname) << SOLD_LOG_KEY(version)
<< ", resolved version:" << SOLD_LOG_KEY(versym);
}
}
}
Expand Down

0 comments on commit 555d98c

Please sign in to comment.