This is an archive of the discontinued LLVM Phabricator instance.

Use ELF dynamic symbols for disassembly
ClosedPublic

Authored by samparker on Feb 7 2017, 4:54 AM.

Details

Summary

Disassembly currently begins from addresses obtained from the objects symbol table. For ELF, also add the dynamic symbols to the list so that we can more successfully disassemble stripped binaries.

Diff Detail

Repository
rL LLVM

Event Timeline

samparker created this revision.Feb 7 2017, 4:54 AM
davidb added a subscriber: davidb.Feb 7 2017, 5:52 AM
davidb added a comment.Feb 7 2017, 6:29 AM

Hi Sam,

In the case that an ELF binary has both a static and dynamic symbol table present the list of symbols will have redundant entries. Perhaps we should only add dynamic ELF symbols in the case that we have no static symbols?

Hi David,

Yes, good point, I will add a check.

Cheers,
sam

samparker updated this revision to Diff 87421.Feb 7 2017, 6:45 AM

Now we only try to add dynamic symbols if there are no static symbols.

samparker updated this revision to Diff 87606.Feb 8 2017, 1:13 AM

Reversed the conditional.

samparker updated this revision to Diff 87608.Feb 8 2017, 1:15 AM

Just added diff context

This revision was automatically updated to reflect the committed changes.