This is an archive of the discontinued LLVM Phabricator instance.

Merge IAT and ILT.
ClosedPublic

Authored by ruiu on May 18 2017, 10:49 AM.

Details

Summary

Previously, LLD-produced executables had IAT (Import Address Table) and
ILT (Import Lookup Table) as separate chunks of data, although their
contents are identical. My interpretation of the COFF spec when I wrote
the COFF linker is that they need to be separate tables even though they
are the same.

But Peter found that the Windows loader is fine with executables in
which IAT and ILT are merged. This is a patch to merge IAT and ILT.
I confirmed that an lld-link self-hosted with this patch works fine.

Fixes https://bugs.llvm.org/show_bug.cgi?id=33064

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.May 18 2017, 10:49 AM
pcc edited edge metadata.May 18 2017, 11:26 AM

Please add a comment somewhere explaining why we can merge them.

lld/COFF/DLL.cpp
430 ↗(On Diff #99463)

I think you could simplify this further by removing the LookupTab field.

ruiu updated this revision to Diff 99482.May 18 2017, 12:41 PM
  • Updated as per pcc's comments.
pcc accepted this revision.May 18 2017, 12:49 PM

LGTM

This revision is now accepted and ready to land.May 18 2017, 12:49 PM
This revision was automatically updated to reflect the committed changes.
rnk added a subscriber: rnk.Jun 2 2017, 11:52 AM

I ended up reverting this in rL304584 because it caused http://crbug.com/729077.