boolean processRelocations(MessageLog log, TaskMonitor monitor) throws CancelledException {

		Address pdwListBeginAddr = relocList.getListStartAddress();
		Address pdwListEndAddr = relocList.getListEndAddress();
		if (pdwListBeginAddr.equals(pdwListEndAddr)) {
			return true; // empty list
		}

		pointerSize = program.getDefaultPointerSize();
		dwAddressDataType = new IBO32DataType(program.getDataTypeManager());

		long size = pdwListEndAddr.subtract(pdwListBeginAddr);

		Memory memory = program.getMemory();

		// First table entry is used to identify implementation version
		int version;

		try {
			if (size >= OLD_STYLE_ENTRY_SIZE && memory.getLong(pdwListBeginAddr) != 0) {
				version = RP_VERSION_V1; // header not used
			}
			else if (size >= NEW_STYLE_ENTRY_HEADER_SIZE) {
				applyPseudoRelocHeader(pdwListBeginAddr, log);
				version = memory.getInt(pdwListBeginAddr.add(8)); // 3rd DWORD is version
				// update table pointer to first item
				pdwListBeginAddr = pdwListBeginAddr.add(NEW_STYLE_ENTRY_HEADER_SIZE);
				size -= NEW_STYLE_ENTRY_HEADER_SIZE; // reduce size by header size
			}
			else {
				log.appendMsg("Unsupported MinGW relocation table at " + pdwListBeginAddr);
				return false;
			}
		}
		catch (MemoryAccessException | AddressOutOfBoundsException e) {
			String msg = "MinGW relocation table processing failed at " + pdwListBeginAddr;
			log.appendMsg(msg);
			Msg.error(this, msg, e);
			return false;
		}

		boolean success;
		switch (version) {
			case RP_VERSION_V1:
				success =
					relocateV1(pdwListBeginAddr, (int) (size / OLD_STYLE_ENTRY_SIZE), log, monitor);
				break;
			case RP_VERSION_V2:
				success = relocateV2(pdwListBeginAddr, (int) (size / NEW_STYLE_ENTRY_HEADER_SIZE),
					log, monitor);
				break;
			default:
				log.appendMsg("Unsupported MinGW relocation table (Version: " + version + ") at " +
					pdwListBeginAddr);
				return false;
		}

		// Cleanup duplicate External Import symbols
		ExternalManager extMgr = program.getExternalManager();
		ReferenceManager refMgr = program.getReferenceManager();
		SymbolTable SymbolList = program.getSymbolTable();
		for (Symbol extSym : program.getSymbolTable().getExternalSymbols()) {
			monitor.checkCancelled();
			ExternalLocation extLoc = extMgr.getExternalLocation(extSym);
			if (extLoc.getOriginalImportedName() != null) {
				continue; // skip - already demangled
			}
			if (refMgr.hasReferencesTo(extSym.getAddress())) {
				continue; // skip - reference exists
			}
			List<Symbol> globalSymbols = SymbolList.getGlobalSymbols(extSym.getName());
			if (globalSymbols.size() != 1) {
				continue;
			}
			Symbol s = globalSymbols.get(0);
			if (memory.isExternalBlockAddress(s.getAddress())) {
				extSym.delete();
			}
		}

		return success;
	}
Construct MinGW pseudo-relocation handler for a Program.
@param program program to be processed
@throws InvalidDataException failed to locate pseudo relocation list in program memory
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java