private int relocate(Memory memory, SegmentRelocation reloc, SegmentedAddress address,
			SegmentedAddress relocAddr) throws MemoryAccessException {

		int value = 0;
		switch (reloc.getType()) {
			case SegmentRelocation.TYPE_LO_BYTE: {
				value = memory.getByte(address) & 0xff;

				memory.setByte(address, (byte) relocAddr.getSegmentOffset());
				break;
			}
			case SegmentRelocation.TYPE_SEGMENT: {
				value = memory.getShort(address) & 0xffff;

				int relocSeg = relocAddr.getSegment();
				memory.setByte(address, (byte) (relocSeg));
				memory.setByte(address.addWrap(1), (byte) (relocSeg >> 8));
				break;
			}
			case SegmentRelocation.TYPE_OFFSET: {
				value = memory.getShort(address) & 0xffff;

				long relocOff = relocAddr.getSegmentOffset();
				memory.setByte(address, (byte) (relocOff));
				memory.setByte(address.addWrap(1), (byte) (relocOff >> 8));
				break;
			}
			case SegmentRelocation.TYPE_FAR_ADDR: {
				value = memory.getInt(address);

				int relocSeg = relocAddr.getSegment();
				long relocOff = relocAddr.getSegmentOffset();

				long farAddr = relocSeg << 16 | relocOff;

				if (reloc.isAdditive()) {
					farAddr += value;
				}
				memory.setInt(address, (int) farAddr);
				break;
			}
			case SegmentRelocation.TYPE_FAR_ADDR_48: {
				break;
			}
			case SegmentRelocation.TYPE_OFFSET_32: {
				break;
			}
		}
		return value;
	}
This method creates an artificial memory block
that will serve as a jump table for imported
libraries.
Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/NeLoader.java