@Override
	public RelocationResult relocate(MachoRelocation relocation)
			throws MemoryAccessException, RelocationException {

		if (!relocation.requiresRelocation()) {
			return RelocationResult.SKIPPED;
		}
		
		RelocationInfo relocationInfo = relocation.getRelocationInfo();		
		Address relocAddr = relocation.getRelocationAddress();
		Address targetAddr = relocation.getTargetAddress();
		long addend = read(relocation);

		int byteLength;
		switch (relocationInfo.getType()) {
			case X86_64_RELOC_UNSIGNED:
				byteLength = write(relocation, targetAddr.add(addend).getOffset());
				break;
			case X86_64_RELOC_SIGNED:
			case X86_64_RELOC_BRANCH:
			case X86_64_RELOC_GOT_LOAD:
			case X86_64_RELOC_GOT:
			case X86_64_RELOC_SIGNED_1: // addend should already be -1
			case X86_64_RELOC_SIGNED_2: // addend should already be -2
			case X86_64_RELOC_SIGNED_4: // addend should already be -4
				byteLength = write(relocation, targetAddr.add(addend).subtract(relocAddr) - 4);
				break;
			case X86_64_RELOC_SUBTRACTOR:
				Address targetAddrExtra = relocation.getTargetAddressExtra();
				if (addend > 0) {
					byteLength =
						write(relocation, targetAddrExtra.add(addend).subtract(targetAddr));
				}
				else {
					byteLength =
						write(relocation, targetAddr.add(addend).subtract(targetAddrExtra));
				}
				break;
				
			case X86_64_RELOC_TLV:      // not seen yet
			default:
				return RelocationResult.UNSUPPORTED;
		}
		return new RelocationResult(Status.APPLIED, byteLength);
	}
A {@link MachoRelocationHandler} for x86 64-bit

@see <a href="https://opensource.apple.com/source/xnu/xnu-7195.81.3/EXTERNAL_HEADERS/mach-o/x86_64/reloc.h.auto.html">mach-o/x86_64/reloc.h</a>
Ghidra/Processors/x86/src/main/java/ghidra/app/util/bin/format/macho/relocation/X86_64_MachoRelocationHandler.java