This is an archive of the discontinued LLVM Phabricator instance.

Produce an error on non-encodable offsets for darwin ARM scattered relocations.
ClosedPublic

Authored by dzn on Nov 20 2018, 2:54 PM.

Details

Summary

Scattered ARM relocations for Mach-O's only have 24 bits available to encode the offset. This is not checked but just truncated and can result in corrupt binaries after linking because the relocations are applied to the wrong offset. This patch will check and error out in those situations instead of emitting a wrong relocation.

Diff Detail

Repository
rL LLVM

Event Timeline

dzn created this revision.Nov 20 2018, 2:54 PM
dzn added a comment.Nov 20 2018, 2:56 PM

Not sure if this warrants the #include "llvm/Support/ScopedPrinter.h" or if a different message is preferred instead.

m4yers added a subscriber: m4yers.Nov 21 2018, 12:27 AM
thegameg accepted this revision.Nov 29 2018, 12:25 PM

Sorry for the delay. LGTM, thanks!

This revision is now accepted and ready to land.Nov 29 2018, 12:25 PM
This revision was automatically updated to reflect the committed changes.