{"record":{"id":"65bb17f9a0961f79","repo":"NationalSecurityAgency/ghidra","slug":"mismatched-mingw-relocation-list-start-end","errorCode":null,"errorMessage":"Mismatched MinGW relocation list start/end: {} / {}","messagePattern":"Mismatched MinGW relocation list start/end: (.+?) / (.+?)","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"warning","filePath":"Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java","lineNumber":138,"sourceCode":"\n\tprivate Program program;\n\tprivate Address pdwListStartAddr;\n\tprivate Address pdwListEndAddr;\n\tprivate boolean listLabelsFound;\n\n\tMinGWPseudoRelocList(Program program, TaskMonitor monitor)\n\t\t\tthrows InvalidDataException, CancelledException {\n\t\tthis.program = program;\n\t\tif (!findLabeledPseudoRelocList()) {\n\t\t\tif (program.getDefaultPointerSize() == 8) {\n\t\t\t\tfindUnlabeledPseudoRelocList64Bit(monitor);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfindUnlabeledPseudoRelocList32Bit(monitor);\n\t\t\t}\n\t\t}\n\t\tif (getDataBlock(pdwListStartAddr) != getDataBlock(pdwListEndAddr)) {\n\t\t\tthrow new InvalidDataException(\"Mismatched MinGW relocation list start/end: \" +\n\t\t\t\tpdwListStartAddr + \" / \" + pdwListEndAddr);\n\t\t}\n\t}\n\n\tprivate MemoryBlock getDataBlock(Address addr) throws InvalidDataException {\n\t\tMemoryBlock block = program.getMemory().getBlock(addr);\n\t\tif (block == null || !block.isInitialized()) {\n\t\t\tthrow new InvalidDataException(\"Invalid MinGW relocation list location: \" + addr);\n\t\t}\n\t\treturn block;\n\t}\n\n\tboolean listLabelsFound() {\n\t\treturn listLabelsFound;\n\t}\n\n\tprivate void findUnlabeledPseudoRelocList64Bit(TaskMonitor monitor)\n\t\t\tthrows InvalidDataException, CancelledException {","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java#L120-L156","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Disable the MinGW pseudo-relocation analyzer for binaries where the list legitimately spans blocks.","Verify the binary is a genuine MinGW-compiled PE with __RUNTIME_PSEUDO_RELOC_LIST__ symbols intact.","Re-run with a fresh/correct binary; re-import the PE so block boundaries are correct.","Catch InvalidDataException and let analysis continue without pseudo-reloc handling."],"exampleFix":"// before — analyzer constructor throws during auto-analysis\nnew MinGWPseudoRelocList(program, monitor);\n\n// after — tolerate the failure in your analysis driver\ntry {\n    new MinGWPseudoRelocList(program, monitor);\n} catch (InvalidDataException e) {\n    log.appendMsg(\"Skipping MinGW pseudo-reloc: \" + e.getMessage());\n}","handlingStrategy":"try-catch","validationCode":"MemoryBlock startBlock = program.getMemory().getBlock(pdwListStartAddr);\nMemoryBlock endBlock = program.getMemory().getBlock(pdwListEndAddr);\nif (startBlock != endBlock) {\n    // do not construct MinGWPseudoRelocList; spans two blocks\n}","typeGuard":"boolean singleBlock = program.getMemory().getBlock(pdwListStartAddr) == program.getMemory().getBlock(pdwListEndAddr);","tryCatchPattern":"try {\n    new MinGWPseudoRelocList(program, monitor);\n} catch (InvalidDataException e) {\n    log.appendMsg(\"Skipping MinGW pseudo-reloc: \" + e.getMessage());\n}","preventionTips":["Disable the MinGW analyzer for binaries where the list legitimately spans blocks.","Verify genuine MinGW provenance before relying on the analyzer.","Re-import the PE so block boundaries are correct."],"tags":["ghidra","analysis","mingw","pe","invalid-data"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}