This is an archive of the discontinued LLVM Phabricator instance.

[dsymutil] Better support for symbol aliases
ClosedPublic

Authored by JDevlieghere on Sep 25 2017, 3:35 AM.

Details

Summary

This patch adds logic to follow a symbol's aliases when the symbol name
cannot be found in the current object file. It checks the main binary
for the symbol's address and queries the current object for its aliases
(symbols with the same address) before printing out a warning.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Sep 25 2017, 3:35 AM
aprantl accepted this revision.Sep 25 2017, 9:02 AM
aprantl added inline comments.
tools/dsymutil/MachODebugMapParser.cpp
400 ↗(On Diff #116508)

The LLVM style usually avoids bracing single statements.

450 ↗(On Diff #116508)

range-based for?

This revision is now accepted and ready to land.Sep 25 2017, 9:02 AM
friss added inline comments.Sep 25 2017, 9:26 AM
tools/dsymutil/MachODebugMapParser.cpp
389–395 ↗(On Diff #116508)

I'm not sure I could construct a test case to trigger a bug here, but I think it would be safer to add as "Type != MachO::N_STSYM" condition to this if. I don't think it's possible to alias static symbols.

  • Feedback Adrian & Fred
This revision was automatically updated to reflect the committed changes.
JDevlieghere marked 2 inline comments as done.