This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Correctly set the thumb bit in DLL export addresses
ClosedPublic

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

Details

Summary

The same adjustment is already done for the entry point in Writer.cpp and for relocations that point to executable code in Chunks.cpp.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Jul 22 2017, 2:19 PM
compnerd edited edge metadata.Jul 22 2017, 4:40 PM

Does link actually set the ISA selection bit on the EAT entries? I don't remember that behaviour from it and I dont have it on hand to check.

COFF/DLL.cpp
331 ↗(On Diff #107801)

Don't use +1. If the ISA selection bit is set, then you will have erased it.

Does link actually set the ISA selection bit on the EAT entries? I don't remember that behaviour from it and I dont have it on hand to check.

Yes, I checked with MS link.exe and this matches what it does.

COFF/DLL.cpp
331 ↗(On Diff #107801)

Ok, will change into | 1 instead.

mstorsjo updated this revision to Diff 107812.Jul 23 2017, 3:00 AM

Updated to use | 1 instead of + 1 for setting the bit, renamed the variable from Offset to Bit accordingly.

ruiu added inline comments.Jul 24 2017, 10:56 AM
test/COFF/Inputs/export-armnt.yaml
1 ↗(On Diff #107812)

Move the contents of this file to test/COFF/export-armnt.test to remove this file. Usually, when there's only one input file, you can write it in the test file itself.

mstorsjo updated this revision to Diff 107952.Jul 24 2017, 1:19 PM

Merged the test input data into the test itself, as suggested by Rui.

mstorsjo marked 2 inline comments as done.Jul 24 2017, 1:20 PM
ruiu accepted this revision.Jul 24 2017, 3:08 PM

LGTM

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