This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ELF] - Show symbols visibility in "undefined symbol..." error messages.
ClosedPublic

Authored by grimar on Feb 23 2019, 4:28 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Feb 23 2019, 4:28 AM
grimar updated this revision to Diff 189486.Mar 6 2019, 5:07 AM
  • Rebased, improved.

Are we going to do this change?

ruiu accepted this revision.Mar 11 2019, 5:15 PM

LGTM

ELF/Relocations.cpp
687 ↗(On Diff #189486)

nit: if you make Visibility a std::string, you could remove str(). But perhaps this is slightly more straightforward:

std::string Msg = "undefined ";

if (Sym.Visibility == STV_INTERNAL)
  Msg += "internal ";
else if (Sym.Visibility == STV_HIDDEN)
  Msg += "hidden ";
else if (Sym.Visibility == STV_PROTECTED)
  Msg += "protected ";

Msg += "symbol: " + toString(Sym) + "\n>>> referenced by ";
This revision is now accepted and ready to land.Mar 11 2019, 5:15 PM
This revision was automatically updated to reflect the committed changes.
grimar marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2019, 4:11 AM