This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readelf] - Implement --addrsig option.
ClosedPublic

Authored by grimar on Oct 5 2020, 7:10 AM.

Details

Summary

We have --addrsig implemented for llvm-readobj.
Usually it is convenient to use a single tool for dumping,
so it seems we might want to implement --addrsig for llvm-readelf too.

I've selected a simple output format which is a bit similar to one,
used for dumping of the symbol table. It looks like:

Address-significant symbols section '.llvm_addrsig' contains 2 entries:
   Num: Name
     1: foo
     2: bar

Diff Detail

Event Timeline

grimar created this revision.Oct 5 2020, 7:10 AM
Herald added a project: Restricted Project. · View Herald Transcript
grimar requested review of this revision.Oct 5 2020, 7:10 AM
MaskRay accepted this revision.Oct 5 2020, 4:41 PM

Thanks!

llvm/tools/llvm-readobj/ELFDumper.cpp
4775

Can Twine be leveraged to avoid the temporary std::string construction?

This revision is now accepted and ready to land.Oct 5 2020, 4:41 PM
grimar added a comment.Oct 6 2020, 1:43 AM

Thanks for review! I'll hold this a bit to see if @jhenderson is also happy with the output format etc.

llvm/tools/llvm-readobj/ELFDumper.cpp
4775

format_decimal returns FormattedNumber, it can't be use to construct a Twine, so seems we can't save anything here.

jhenderson accepted this revision.Oct 7 2020, 3:13 AM

LGTM too.

This revision was automatically updated to reflect the committed changes.