This is an archive of the discontinued LLVM Phabricator instance.

RISCV: Add IMAGE_FILE_MACHINE COFF address spaces
ClosedPublic

Authored by martell on Dec 24 2017, 10:32 PM.

Details

Summary

PE spec defines and reserves to following for RISCV

IMAGE_FILE_MACHINE_RISCV32 0x5032
IMAGE_FILE_MACHINE_RISCV64 0x5064
IMAGE_FILE_MACHINE_RISCV128 0x5128

https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx

Adds support to COFFDumper and COFFYAML interchange.

Diff Detail

Repository
rL LLVM

Event Timeline

martell created this revision.Dec 24 2017, 10:32 PM
martell edited the summary of this revision. (Show Details)
martell retitled this revision from RISCV: Add COFF address space to RISCV: Add IMAGE_FILE_MACHINE COFF address spaces.
compnerd accepted this revision.Dec 25 2017, 3:27 PM

Cn you add a roundtrip test through yaml2obj/obj2yaml and a test for the COFF dumper?

This revision is now accepted and ready to land.Dec 25 2017, 3:27 PM
asb added a comment.Dec 26 2017, 1:40 AM

With the addition of a test this looks good to me, thanks! Please try and remember to upload patches with full context (http://llvm.org/docs/Phabricator.html).

asb added a comment.Jan 17 2018, 6:02 AM

Hi @martell, do you think you might have time to add a test for this?

Sorry for the delay,
I looked back on this a few times and I don't have the relocations to support doing a full round trip.
It does seem however that tests are only done for the 4 fully supported arch's.
IMAGE_FILE_MACHINE_I386
IMAGE_FILE_MACHINE_AMD64
IMAGE_FILE_MACHINE_ARMNT
IMAGE_FILE_MACHINE_ARM64
see obj2yaml.test for reference.

Update:

I noticed that this actually fail for the other arches when I added support for RISCV in a test case.
I think this is because we need relocations for a proper testcase like x86 and arm.

I will change this to only add it in include/llvm/BinaryFormat/COFF.h and commit that for now.

This revision was automatically updated to reflect the committed changes.