private void processRelocations(Program program, SegmentedAddressSpace space, MzExecutable mz,
			Set<RelocationFixup> relocationFixups, MessageLog log, TaskMonitor monitor)
			throws Exception {
		monitor.setMessage("Processing relocations...");
		Memory memory = program.getMemory();

		for (RelocationFixup relocationFixup : relocationFixups) {
			SegmentedAddress relocationAddress = relocationFixup.address();
			Status status = Status.FAILURE;
			try {
				if (relocationFixup.valid) {
					memory.setShort(relocationAddress, (short) relocationFixup.segment());
					status = Status.APPLIED;
				}
			}
			catch (MemoryAccessException e) {
				log.appendMsg(String.format("Failed to apply relocation: %s (%s)",
					relocationAddress, e.getMessage()));
			}

			// Add to relocation table
			program.getRelocationTable()
					.add(relocationAddress, status, 0,
						new long[] { relocationFixup.relocation.getSegment(),
							relocationFixup.relocation.getOffset(), relocationFixup.segment },
						2, null);
		}
	}
Stores a relocation's fixup information

@param relocation The original relocation info
@param address The {@link SegmentedAddress} of the relocation
@param fileOffset The file offset of the relocation
@param segment The fixed-up segment after the relocation is applied
@param valid True if the relocation is valid; otherwise, false
Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MzLoader.java