This is an archive of the discontinued LLVM Phabricator instance.

Make llvm-tli-checker support static libraries
ClosedPublic

Authored by probinson on Sep 7 2022, 12:49 PM.

Details

Summary

The original implementation assumed dynamic libraries and so looked
only at the dynamic symbol table. Use the regular symbol table for
ET_REL files.

Diff Detail

Event Timeline

probinson created this revision.Sep 7 2022, 12:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2022, 12:49 PM
probinson requested review of this revision.Sep 7 2022, 12:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2022, 12:49 PM

A few nits, but looks good to me, thanks!

llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
167

Nit:

// Insert defined global function symbols into the map if valid.
168

Feels weird to pass the end() iterator here, because in theory you could pass any valid iterator and it wouldn't be the same logic.

I think passing a reference to the object and then using Section != o.section_end() would be more clear as well as avoiding improper use by accident.

176

Nit: I'd wrap this in curly brackets because of the two-line if statement.

probinson updated this revision to Diff 458729.Sep 8 2022, 7:08 AM

Address review comments.

probinson marked 3 inline comments as done.Sep 8 2022, 7:13 AM
probinson added inline comments.
llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
168

Yeah, passing the ObjectFile does help avoid mistakes.

176

OK. And that lets me sink the getName() inside the if as well.

rengolin accepted this revision.Sep 8 2022, 7:59 AM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 8 2022, 7:59 AM
This revision was landed with ongoing or failed builds.Sep 8 2022, 11:10 AM
This revision was automatically updated to reflect the committed changes.
probinson marked 2 inline comments as done.