This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] [COFF] Resolve relocations pointing at section symbols for arm64 too
ClosedPublic

Authored by mstorsjo on Sep 11 2021, 12:23 PM.

Details

Summary

This syncs parts from the x86 implementation to the ARMWinEH
implementation.

Currently, neither of the compilers targeting COFF/arm64 (MSVC, LLVM)
produce such relocations, but LLVM might after a later patch.

Diff Detail

Event Timeline

mstorsjo created this revision.Sep 11 2021, 12:23 PM
mstorsjo requested review of this revision.Sep 11 2021, 12:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 11 2021, 12:23 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

Couple of minor comments, since my Herald rule added me, but @rnk should do the real review.

llvm/test/tools/llvm-readobj/COFF/arm64-unwind-preferred-symbol2.yaml
19

I've not got much experience with yaml2obj for COFF, but is this reasonably minimal? It looks like a lot of data, for what looks like a fairly small piece of testing.

llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
292

Nit: add missing full stop whilst you're moving this comment.

mstorsjo added inline comments.Sep 13 2021, 4:56 AM
llvm/test/tools/llvm-readobj/COFF/arm64-unwind-preferred-symbol2.yaml
19

It's two functions that are nontrivial enough to actually generate unwind info, and one of them even less trivial so that it can't be described with the packed unwind info format. (The packed unwind info format has one relocation, the full format has two relocations, thus wanting to include both forms in the test.)

Sure there's no strict need to have valid code here, but it doesn't cost anything with regards to actual number of lines in this test, and makes for a slightly more understandable example to have the code actually match the unwind info.

llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
292

Sure, will do.

rnk accepted this revision.Sep 13 2021, 3:21 PM

lgtm

This revision is now accepted and ready to land.Sep 13 2021, 3:21 PM
This revision was landed with ongoing or failed builds.Sep 14 2021, 1:24 AM
This revision was automatically updated to reflect the committed changes.