NationalSecurityAgency/ghidra · warning · InvalidDataException

Invalid MinGW relocation list location: {}

Error message

Invalid MinGW relocation list location: {}

What it means

Thrown as InvalidDataException by MinGWPseudoRelocList.getDataBlock when the address passed in has no memory block, or its block is not initialized. The pseudo-relocation list must live in initialized memory; an address outside memory or in an uninitialized block makes the data unreadable and the analysis invalid.

Source

Thrown at Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java:146

		this.program = program;
		if (!findLabeledPseudoRelocList()) {
			if (program.getDefaultPointerSize() == 8) {
				findUnlabeledPseudoRelocList64Bit(monitor);
			}
			else {
				findUnlabeledPseudoRelocList32Bit(monitor);
			}
		}
		if (getDataBlock(pdwListStartAddr) != getDataBlock(pdwListEndAddr)) {
			throw new InvalidDataException("Mismatched MinGW relocation list start/end: " +
				pdwListStartAddr + " / " + pdwListEndAddr);
		}
	}

	private MemoryBlock getDataBlock(Address addr) throws InvalidDataException {
		MemoryBlock block = program.getMemory().getBlock(addr);
		if (block == null || !block.isInitialized()) {
			throw new InvalidDataException("Invalid MinGW relocation list location: " + addr);
		}
		return block;
	}

	boolean listLabelsFound() {
		return listLabelsFound;
	}

	private void findUnlabeledPseudoRelocList64Bit(TaskMonitor monitor)
			throws InvalidDataException, CancelledException {

		findUnlabeledPseudoRelocList(monitor);

	}

	private void findUnlabeledPseudoRelocList32Bit(TaskMonitor monitor)
			throws InvalidDataException, CancelledException {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Confirm the program was fully imported with all sections loaded into initialized memory.
  2. Check that the resolved address is within an initialized block before constructing MinGWPseudoRelocList.
  3. Disable the analyzer for binaries known to lack a valid pseudo-reloc list.
  4. Catch InvalidDataException and skip pseudo-reloc processing for that binary.

Example fix

// before
MemoryBlock b = getDataBlock(addr); // throws if addr not in initialized memory

// after — validate block presence first
MemoryBlock b = program.getMemory().getBlock(addr);
if (b == null || !b.isInitialized()) {
    throw new InvalidDataException("Invalid MinGW relocation list location: " + addr);
}
Defensive patterns

Strategy: validation

Validate before calling

MemoryBlock b = program.getMemory().getBlock(addr);
if (b == null || !b.isInitialized()) {
    // address not usable; skip pseudo-reloc construction
}

Type guard

boolean inInitBlock = program.getMemory().getBlock(addr) != null && program.getMemory().getBlock(addr).isInitialized();

Try / catch

try {
    new MinGWPseudoRelocList(program, monitor);
} catch (InvalidDataException e) {
    log.appendMsg("MinGW pseudo-reloc list unusable: " + e.getMessage());
}

Prevention

When it happens

Trigger: getMemory().getBlock(addr) returns null (address outside any block), or block.isInitialized() is false (e.g. address in a .bss-like uninitialized block), for either the list start or end address.

Common situations: The pseudo-reloc pointer resolves to an external/import address rather than a real list address; a malformed PE with bad relocation metadata; the binary's memory layout changed between import versions; analyzing a partially-loaded program where the relevant block was not loaded.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/59b6d83b50a6504f. Report an issue: GitHub.