{"record":{"id":"387e7e30f100586f","repo":"NationalSecurityAgency/ghidra","slug":"mingw-pseudo-relocation-list-not-found","errorCode":null,"errorMessage":"MinGW pseudo-relocation list not found","messagePattern":"MinGW pseudo-relocation list not found","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"warning","filePath":"Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java","lineNumber":173,"sourceCode":"\tprivate void findUnlabeledPseudoRelocList64Bit(TaskMonitor monitor)\n\t\t\tthrows InvalidDataException, CancelledException {\n\n\t\tfindUnlabeledPseudoRelocList(monitor);\n\n\t}\n\n\tprivate void findUnlabeledPseudoRelocList32Bit(TaskMonitor monitor)\n\t\t\tthrows InvalidDataException, CancelledException {\n\n\t\tfindUnlabeledPseudoRelocList(monitor);\n\t}\n\n\tprivate void findUnlabeledPseudoRelocList(TaskMonitor monitor)\n\t\t\tthrows InvalidDataException, CancelledException {\n\n\t\t//TODO: find a way to recognize type0 ones\n\t\tif (!findUnlabledType1PseudoRelocList(monitor)) {\n\t\t\tthrow new InvalidDataException(\"MinGW pseudo-relocation list not found\");\n\t\t}\n\t\tcreatePrimaryLabel(pdwListStartAddr, PSEUDO_RELOC_LIST_START_NAME);\n\t\tcreatePrimaryLabel(pdwListEndAddr, PSEUDO_RELOC_LIST_END_NAME);\n\t\tlistLabelsFound = true;\n\t}\n\n\tprivate boolean findUnlabledType1PseudoRelocList(TaskMonitor monitor)\n\t\t\tthrows CancelledException {\n\n\t\tMemoryBlock block = program.getMemory().getBlock(\".rdata\");\n\t\tif (block == null) {\n\t\t\tMsg.error(this, \"Cannot find a .rdata block\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// first look backwards from end of .rdata to find the last occurance of \"GCC:\" in the\n\t\t// .rdata block\n\t\tbyte[] gccBytes = \"GCC:\".getBytes();","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java#L155-L191","documentation":"Thrown as InvalidDataException by findUnlabeledPseudoRelocList when findUnlabledType1PseudoRelocList returns false — the analyzer could not locate the type-1 pseudo-relocation list by scanning .rdata and labels were not already present. It means the binary either is not MinGW-compiled or its pseudo-reloc list is not in the expected form.","triggerScenarios":"The type-1 pseudo-reloc discovery scan (findUnlabledType1PseudoRelocList) fails: .rdata block absent, the expected header pattern not found, or the monitor cancelled the scan before completion. findLabeledPseudoRelocList also returned false (no labels), so the unlabeled path is the last resort and it failed.","commonSituations":"Running the MinGW analyzer on a non-MinGW PE or an ELF; an older/newer MinGW runtime that uses type-0 relocations (the TODO notes type-0 is unrecognized); a stripped binary whose .rdata heuristic no longer matches; very small binaries with no .rdata.","solutions":["Confirm the binary was produced by MinGW (check compiler metadata); disable the analyzer otherwise.","If labels are expected, add __RUNTIME_PSEUDO_RELOC_LIST_START__/__END__ labels manually so the labeled path succeeds.","Re-import the PE ensuring the .rdata section is present and loaded.","Catch InvalidDataException and continue analysis without pseudo-reloc relocations."],"exampleFix":"// before — analyzer throws during auto-analysis on a non-MinGW binary\nnew MinGWPseudoRelocList(program, monitor);\n\n// after — guard with analyzer applicability and tolerate failure\nif (!MingwRelocationAnalyzer.isMinGwBinary(program)) {\n    return; // not applicable\n}\ntry {\n    new MinGWPseudoRelocList(program, monitor);\n} catch (InvalidDataException e) {\n    log.appendMsg(\"No MinGW pseudo-reloc list: \" + e.getMessage());\n}","handlingStrategy":"try-catch","validationCode":"// confirm MinGW provenance and .rdata presence before constructing\nif (!MingwRelocationAnalyzer.isMinGwBinary(program)\n    || program.getMemory().getBlock(\".rdata\") == null) {\n    return; // analyzer not applicable\n}","typeGuard":"boolean applicable = MingwRelocationAnalyzer.isMinGwBinary(program) && program.getMemory().getBlock(\".rdata\") != null;","tryCatchPattern":"try {\n    new MinGWPseudoRelocList(program, monitor);\n} catch (InvalidDataException e) {\n    log.appendMsg(\"No MinGW pseudo-reloc list: \" + e.getMessage());\n}","preventionTips":["Disable the MinGW analyzer for non-MinGW binaries.","Add the START/END labels manually if the list is known but unlabeled.","Tolerate InvalidDataException in automated analysis pipelines."],"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"}