This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] Support nonzero section addresses in addSymbolizer
ClosedPublic

Authored by Pierre-vh on Oct 7 2022, 1:12 AM.

Details

Summary

The previous calculations seem to have assumed that the section address would be zero.
This is true for relocatable object files, but certainly not for linked files like shared libraries.

Fixed the calculations to make them identical to the "real" getInstruction call below & added a regression test.

Diff Detail

Event Timeline

Pierre-vh created this revision.Oct 7 2022, 1:12 AM
Herald added a project: Restricted Project. · View Herald Transcript
Pierre-vh requested review of this revision.Oct 7 2022, 1:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 1:12 AM
scott.linder accepted this revision.Oct 11 2022, 3:08 PM

LGTM, thank you! I wasn't aware of the change which caused the regression in https://reviews.llvm.org/D130357

I left a comment to confirm there isn't something more subtle happening, but regardless the code is clearly incorrect.

This revision is now accepted and ready to land.Oct 11 2022, 3:08 PM
simon_tatham accepted this revision.Oct 12 2022, 1:22 AM
simon_tatham added a subscriber: simon_tatham.

No, I think this was exactly the mistake on my part that it looks like. Good catch, and thanks for fixing it!