This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] Add support for dumping CHPE metadata.
ClosedPublic

Authored by jacek on Apr 24 2023, 12:46 PM.

Details

Summary

CHPE metadata is used by ARM64EC/ARM64X PE files to provide metadata for emulator/loader. Most of this metadata will need to be generated by LLD.

Diff Detail

Event Timeline

jacek created this revision.Apr 24 2023, 12:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2023, 12:46 PM
jacek requested review of this revision.Apr 24 2023, 12:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2023, 12:46 PM
efriedma added inline comments.Apr 24 2023, 1:05 PM
llvm/lib/Object/COFFObjectFile.cpp
758

Does "is64()" here refer to whether the target is 32-bit? I guess 32-bit ARM CHPE is a thing that exists, but it doesn't look like the rest of the code is built to accept it; I'd rather bail out as soon as possible.

llvm/tools/llvm-readobj/COFFDumper.cpp
924

Not sure you need to print CodeRangesToEntryPointsCount/RedirectionMetadataCount separately? You can easily infer it from what is already dumped.

jacek updated this revision to Diff 516769.Apr 25 2023, 6:03 AM

Thanks. Yes, 32-bit CHPE looks very different, the new version of the patch limits its use to 64-bit targets. I also removes dumping redundant *Count variables. Also, similar to D149091, I changed the test to use yaml2obj.

This revision is now accepted and ready to land.Apr 27 2023, 2:15 PM

Seems that this patch hasn't landed?

This revision was landed with ongoing or failed builds.Jun 30 2023, 5:58 AM
This revision was automatically updated to reflect the committed changes.
jacek added a comment.Jun 30 2023, 6:04 AM

Seems that this patch hasn't landed?

I was hoping to land D149439 and D149440 first, which would allow a bit nicer tests here. I landed the patch now and I will add clean up there.