This is an archive of the discontinued LLVM Phabricator instance.

X86MachObjectWriter: Allow subtractors with undefined targets.
Needs ReviewPublic

Authored by jckarter on Jan 17 2018, 6:33 PM.

Details

Reviewers
lhames
lgerbarg
Summary

This appears to work and be supported by ld64 on Darwin. The subtraction is represented symbolically in the Mach-O object format, and ld64 relocates the offset when the target is a weak or coalesced definition and appears to still do so when the target is undefined. (Possibly it even works with an undefined base, but I don't need that for my use case and didn't thoroughly test it.)

Diff Detail

Repository
rL LLVM

Event Timeline

jckarter created this revision.Jan 17 2018, 6:33 PM