This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy][COFF] Add support for extended relocation tables
ClosedPublic

Authored by sdmitriev on Nov 13 2019, 1:41 PM.

Details

Summary

This patch adds support for COFF objects with extended relocation tables to the llvm-objcopy tool.

Diff Detail

Event Timeline

sdmitriev created this revision.Nov 13 2019, 1:41 PM

The code looks good to me, but it would be good to have a testcase that actually covers the writing part of the patch. As far as I see, the testcase only checks that we don't error out if the extended relocations flag is set on input, but as the test object doesn't actually have that many relocations, it doesn't invoke that bit of the writer.

One can use gzipped object files (see COFF/bigobj.test for an example) for testcases where one needs a slightly larger test file.

sdmitriev updated this revision to Diff 229195.Nov 13 2019, 3:32 PM
sdmitriev edited the summary of this revision. (Show Details)

Added real object with extended relocations for LIT test.

This revision is now accepted and ready to land.Nov 13 2019, 10:55 PM

I think using generated object in the test is more preferable since yaml definition can be adjust if there would be a need for that, but it turned out that yaml2obj tool also has problems with COFF’s extended relocation tables. I have prepared a patch to fix this problem in the yaml2obj – D70251

I am going to commit this patch as is now and change it to use generated object once I commit D70251.

This revision was automatically updated to reflect the committed changes.