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
Diff Detail
- Repository
- rL LLVM