This is an archive of the discontinued LLVM Phabricator instance.

[COFF] ARM64 support for COFFImportFile
ClosedPublic

Authored by mstorsjo on Jul 22 2017, 2:17 PM.

Details

Summary

Tested that a DLL+implib created with LLD seems to load properly. What would be a suitable location for a testcase for this? Some sort of higher level test in LLD?

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Jul 22 2017, 2:17 PM

You should be able to generate an object file with the imgrel relocation.

You should be able to generate an object file with the imgrel relocation.

That doesn't actually test this codepath, that's already handled within lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp, where VK_COFF_IMGREL32 is mapped to COFF::IMAGE_REL_ARM64_ADDR32NB. The only place where this getImgRelRelocation function is used is within COFFImportFile.cpp, in the createImportDescriptor function.

ruiu edited edge metadata.Jul 24 2017, 10:53 AM

Can you add a test?

In D35766#819125, @ruiu wrote:

Can you add a test?

Yes, I'd like to. In the original comment, I asked for suggestions on where/how to add such a test. Are there any tool entry points within llvm that actually use this functionality? Maybe llvm-dlltool; are there any other? It'd be easy to test this from within lld though.

ruiu added a comment.Jul 24 2017, 12:12 PM

The file used to be part of lld, so I think this is tested by some test file in lld. Can you add a new test if there's such file?

ruiu accepted this revision.Jul 24 2017, 2:40 PM

LGTM

This revision is now accepted and ready to land.Jul 24 2017, 2:40 PM
This revision was automatically updated to reflect the committed changes.