private void processRelocations(SegmentTable st, ImportedNameTable imp,
			ModuleReferenceTable mrt, RelocationTable relocTable, Program program, Memory memory,
			SegmentedAddressSpace space, MessageLog log, TaskMonitor monitor) throws IOException {
		SymbolTable symbolTable = program.getSymbolTable();
		Segment[] segments = st.getSegments();
		for (int s = 0; s < segments.length; ++s) {
			if (monitor.isCancelled()) {
				return;
			}
			SegmentRelocation[] relocs = segments[s].getRelocations();
			for (SegmentRelocation reloc : relocs) {
				if (monitor.isCancelled()) {
					return;
				}

				int segment = st.getSegments()[s].getSegmentID();
				int offset = Short.toUnsignedInt(reloc.getOffset());
				SegmentedAddress relocAddr = null;

				if (reloc.isInternalRef()) {
					if (reloc.getTargetSegment() == SegmentRelocation.MOVEABLE) {
						relocAddr = (SegmentedAddress) entryPointList.get(reloc.getTargetOffset());
					}
					else {
						int seg = st.getSegments()[reloc.getTargetSegment() - 1].getSegmentID();
						int off = Short.toUnsignedInt(reloc.getTargetOffset());
						relocAddr = space.getAddress(seg, off);
					}
				}
				else if (reloc.isImportName()) {
					String modname = getRelocationModuleName(mrt, reloc);
					String procname = imp.getNameAt(reloc.getTargetOffset()).getString();
					relocAddr = getImportSymbolByName(symbolTable, modname, procname);
				}
				else if (reloc.isImportOrdinal()) {
					String modname = getRelocationModuleName(mrt, reloc);
					int ordinal = Short.toUnsignedInt(reloc.getTargetOffset());
					String procname = SymbolUtilities.ORDINAL_PREFIX + ordinal;
					relocAddr = getImportSymbolByName(symbolTable, modname, procname);
				}
				else if (reloc.isOpSysFixup()) {
					// short fixupType = relocs[r].getTargetSegment();
					//todo: import os fixup...
				}

				if (relocAddr == null) {
					continue;
				}

				int relocType = reloc.getType();
				int byteLength = SegmentRelocation.TYPE_LENGTHS[relocType];

				do {
					// TODO: it appears that offset may be a far-offset and not always a segment-offset
					SegmentedAddress address = space.getAddress(segment, offset);
					try {
						offset = relocate(memory, reloc, address, relocAddr);
						relocTable.add(address, Status.APPLIED, relocType, reloc.getValues(),
							byteLength, null);
					}
					catch (MemoryAccessException e) {
						log.appendMsg("Relocation does not exist in memory: " + relocAddr);
						break;
					}
					if (reloc.isAdditive()) {
						break;
					}
					if (offset <= 0 || offset >= 0xffff) {
						break;
					}
					if (monitor.isCancelled()) {
						break;
					}
				}
				while (true);
			}
		}
	}
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