This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Drop '>>> defined in ' for locations of linker synthesized symbols
ClosedPublic

Authored by MaskRay on Dec 29 2020, 3:13 PM.

Diff Detail

Event Timeline

MaskRay created this revision.Dec 29 2020, 3:13 PM
MaskRay requested review of this revision.Dec 29 2020, 3:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 29 2020, 3:13 PM
grimar accepted this revision.Dec 30 2020, 12:44 AM

LGTM with or without my suggestion.

lld/ELF/Relocations.cpp
82

return ""; might look cleaner here, because a string is returned.

Also, I'd get probably rid of msg variable, because it is not used for all paths now:

static std::string getDefinedLocation(const Symbol &sym) {
  if (sym.file)
    return "\n>>> defined in " + toString(sym.file);
  if (Optional<std::string> loc = getLinkerScriptLocation(sym))
    return "\n>>> defined in " + *loc;
  return "";
}
This revision is now accepted and ready to land.Dec 30 2020, 12:44 AM