This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Make the relocation scanning for CFG more discriminating
ClosedPublic

Authored by hans on Aug 8 2018, 3:22 AM.

Details

Summary

link.exe ignores REL32 relocations on 32-bit x86, as well as relocations against non-function symbols such as labels. This makes lld do the same.

Diff Detail

Event Timeline

hans created this revision.Aug 8 2018, 3:22 AM
thakis accepted this revision.Aug 8 2018, 4:35 AM

lgtm

This revision is now accepted and ready to land.Aug 8 2018, 4:35 AM
hans added a comment.Aug 8 2018, 7:05 AM

I tried this out on 32-bit Chrome's setup.exe, and the cf function table shrinks from 4302 functions to 1160.

This revision was automatically updated to reflect the committed changes.
rnk added a comment.Aug 9 2018, 7:18 AM

Thanks!

test/COFF/gfids-relocations32.s
12

If readobj could symbolize, perhaps with the export table, we could make this readable.