This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readelf]Merge dynamic and static relocation printing to avoid code duplication
ClosedPublic

Authored by jhenderson on Mar 26 2019, 8:54 AM.

Details

Summary

The majority of the printRelocation and printDynamicRelocation functions were identical. This patch factors this all out into a new function. There are a couple of minor differences to do with printing of symbols without names, but I think these are harmless, and in some cases a small improvement.

Diff Detail

Repository
rL LLVM

Event Timeline

jhenderson created this revision.Mar 26 2019, 8:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 26 2019, 8:54 AM
rupprecht accepted this revision.Mar 26 2019, 6:24 PM
This revision is now accepted and ready to land.Mar 26 2019, 6:24 PM
Higuoxing accepted this revision.Mar 26 2019, 8:36 PM

LGTM

tools/llvm-readobj/ELFDumper.cpp
2601 ↗(On Diff #192285)

Shall we make this->dumper() into local variable? Because I noticed this->dumper() in printRelocation() and printDynamicRelocation() are used twice. But I don't mind.

grimar accepted this revision.Mar 26 2019, 10:55 PM

Nice simplification! LGTM.

This revision was automatically updated to reflect the committed changes.