This is an archive of the discontinued LLVM Phabricator instance.

[dsymutil] Gather local symbol addresses in addition to global in the main executable.
ClosedPublic

Authored by JDevlieghere on Nov 26 2018, 4:17 PM.

Details

Summary

Usually local symbols will have their address described in the debug map.
Global symbols have to have their address looked up in the symbol table
of the main executable. By playing with 'ld -r' and export lists, you
can get a symbol described as global by the debug map while actually
being a local symbol as far as the link in concerned. By gathering the
address of local symbols, we fix this issue.

Also, we prefer a global symbol in case of a name collision to preserve
the previous behavior.

Note that using the 'ld -r' tricks, people can actually cause symbol names
collisions that dsymutil has no way to figure out. This fixes the simple
case where there is only one symbol of a given name.

rdar://problem/32826621

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Nov 26 2018, 4:17 PM
friss accepted this revision.Nov 30 2018, 8:12 AM

LGTM

This revision is now accepted and ready to land.Nov 30 2018, 8:12 AM
This revision was automatically updated to reflect the committed changes.