NationalSecurityAgency/ghidra · warning · InvalidDataException

Mismatched MinGW relocation list start/end: {} / {}

Error message

Mismatched MinGW relocation list start/end: {} / {}

What it means

Thrown as InvalidDataException by the MinGWPseudoRelocList constructor when the discovered pseudo-relocation list start and end addresses fall into different memory blocks (getDataBlock(start) != getDataBlock(end)). The analyzer assumes the list occupies a single contiguous initialized block; straddling two blocks indicates a bad discovery result or a malformed binary.

Source

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

	private Program program;
	private Address pdwListStartAddr;
	private Address pdwListEndAddr;
	private boolean listLabelsFound;

	MinGWPseudoRelocList(Program program, TaskMonitor monitor)
			throws InvalidDataException, CancelledException {
		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 {

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Disable the MinGW pseudo-relocation analyzer for binaries where the list legitimately spans blocks.
  2. Verify the binary is a genuine MinGW-compiled PE with __RUNTIME_PSEUDO_RELOC_LIST__ symbols intact.
  3. Re-run with a fresh/correct binary; re-import the PE so block boundaries are correct.
  4. Catch InvalidDataException and let analysis continue without pseudo-reloc handling.

Example fix

// before — analyzer constructor throws during auto-analysis
new MinGWPseudoRelocList(program, monitor);

// after — tolerate the failure in your analysis driver
try {
    new MinGWPseudoRelocList(program, monitor);
} catch (InvalidDataException e) {
    log.appendMsg("Skipping MinGW pseudo-reloc: " + e.getMessage());
}
Defensive patterns

Strategy: try-catch

Validate before calling

MemoryBlock startBlock = program.getMemory().getBlock(pdwListStartAddr);
MemoryBlock endBlock = program.getMemory().getBlock(pdwListEndAddr);
if (startBlock != endBlock) {
    // do not construct MinGWPseudoRelocList; spans two blocks
}

Type guard

boolean singleBlock = program.getMemory().getBlock(pdwListStartAddr) == program.getMemory().getBlock(pdwListEndAddr);

Try / catch

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

Prevention

When it happens

Trigger: findLabeledPseudoRelocList or findUnlabeledPseudoRelocList resolves pdwListStartAddr and pdwListEndAddr into two distinct MemoryBlocks — e.g. start in .rdata and end in .data, or the end pointer overshooting into an adjacent block.

Common situations: Analyzing a stripped/obfuscated MinGW PE where the pseudo-reloc labels resolve to unexpected addresses; a corrupted or hand-edited binary; a newer MinGW runtime layout the heuristic mis-parses; running the analyzer on a non-MinGW binary that happens to define the symbols.

Related errors


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