This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj/libObject] - Get rid of `FirstSym` argument. NFCI.
ClosedPublic

Authored by grimar on Sep 21 2020, 4:09 AM.

Details

Summary

We use FirstSym argument in getExtendedSymbolTableIndex to calculate
a symbol index:

&Sym - &FirstSym

Instead, we could pass the symbol index directly.
This is what this patch does, it allows to simplify another llvm-readobj API.

Diff Detail

Event Timeline

grimar created this revision.Sep 21 2020, 4:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2020, 4:09 AM
Herald added a subscriber: rupprecht. · View Herald Transcript
jhenderson accepted this revision.Sep 21 2020, 5:37 AM

LGTM, assuming I'm not mistaken in thinking there's another patch related to this one.

llvm/tools/llvm-readobj/ELFDumper.cpp
1190–1193

This is assuming the symbol is from the .symtab symbol table. I seem to remember you are fixing that elsewhere?

This revision is now accepted and ready to land.Sep 21 2020, 5:37 AM
grimar added inline comments.Sep 21 2020, 5:38 AM
llvm/tools/llvm-readobj/ELFDumper.cpp
1190–1193

Yep. Here: D87899