{"record":{"id":"905b6daf6d833aa0","repo":"NationalSecurityAgency/ghidra","slug":"missing-mingw-runtime-pseudo-reloc-list-end-sy","errorCode":null,"errorMessage":"Missing MinGW __RUNTIME_PSEUDO_RELOC_LIST_END__ symbol","messagePattern":"Missing MinGW __RUNTIME_PSEUDO_RELOC_LIST_END__ symbol","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"warning","filePath":"Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java","lineNumber":339,"sourceCode":"\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate boolean findLabeledPseudoRelocList() throws InvalidDataException {\n\t\tSymbol pdwListStart = getLabel(program, PSEUDO_RELOC_LIST_START_NAME);\n\t\tif (pdwListStart == null) {\n\t\t\treturn false;\n\t\t}\n\t\tSymbol pdwListEnd = getLabel(program, PSEUDO_RELOC_LIST_END_NAME);\n\t\tif (pdwListEnd != null) {\n\t\t\tlistLabelsFound = true;\n\t\t\tpdwListStartAddr = pdwListStart.getAddress();\n\t\t\tpdwListEndAddr = pdwListEnd.getAddress();\n\t\t\treturn true;\n\t\t}\n\t\tthrow new InvalidDataException(\"Missing MinGW \" + PSEUDO_RELOC_LIST_END_NAME + \" symbol\");\n\t}\n\n\tprivate static Symbol getLabel(Program program, String name) {\n\t\treturn SymbolUtilities.getExpectedLabelOrFunctionSymbol(program, name, m -> {\n\t\t\t/* ignore */});\n\t}\n\n\tprivate Symbol createPrimaryLabel(Address address, String name) {\n\t\ttry {\n\t\t\tSymbolTable SymbolList = program.getSymbolTable();\n\t\t\tSymbol symbol = SymbolList.createLabel(address, name, null, SourceType.ANALYSIS);\n\t\t\tif (!symbol.isPrimary()) {\n\t\t\t\tsymbol.setPrimary();\n\t\t\t}\n\t\t\treturn symbol;\n\t\t}\n\t\tcatch (InvalidInputException e) {\n\t\t\tthrow new AssertException(\"unexpected\", e);","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/MingwRelocationAnalyzer.java#L321-L357","documentation":"Thrown as InvalidDataException by findLabeledPseudoRelocList when the list-START label (PSEUDO_RELOC_LIST_START_NAME) was found but the list-END label (PSEUDO_RELOC_LIST_END_NAME, i.e. __RUNTIME_PSEUDO_RELOC_LIST_END__) was not. The two labels are expected as a pair; finding only the start indicates a partially labeled or tampered binary.","triggerScenarios":"Symbol lookup for the START label succeeds (non-null) but the END label lookup returns null — e.g. the end symbol was stripped/renamed, or only the start label survived a symbol-table edit.","commonSituations":"Stripped MinGW binary where one of the pair was removed; hand-edited symbol table; a partially linked object; mismatched MinGW runtime versions that emit only one marker.","solutions":["Re-import the original, unstripped PE so both marker symbols are present.","Manually create the missing __RUNTIME_PSEUDO_RELOC_LIST_END__ label at the correct address before re-running the analyzer.","Disable the analyzer for binaries missing the marker pair.","Catch InvalidDataException and fall back to the unlabeled discovery path."],"exampleFix":"// before — findLabeledPseudoRelocList throws because END label is absent\n// (start found, end missing)\n\n// after — create the missing END label, then retry\nSymbol start = SymbolUtilities.getExpectedLabelOrFunctionSymbol(program, PSEUDO_RELOC_LIST_START_NAME, m -> {});\nSymbol end = SymbolUtilities.getExpectedLabelOrFunctionSymbol(program, PSEUDO_RELOC_LIST_END_NAME, m -> {});\nif (start != null && end == null) {\n    Address endAddr = computeListEnd(program, start.getAddress());\n    program.getSymbolTable().createLabel(endAddr, PSEUDO_RELOC_LIST_END_NAME, null, SourceType.ANALYSIS);\n}","handlingStrategy":"validation","validationCode":"Symbol start = SymbolUtilities.getExpectedLabelOrFunctionSymbol(program, PSEUDO_RELOC_LIST_START_NAME, m -> {});\nSymbol end = SymbolUtilities.getExpectedLabelOrFunctionSymbol(program, PSEUDO_RELOC_LIST_END_NAME, m -> {});\nif (start != null && end == null) {\n    // create the missing END label at the computed end address before running\n}","typeGuard":"boolean bothLabels = start != null && end != null;","tryCatchPattern":"try {\n    findLabeledPseudoRelocList();\n} catch (InvalidDataException e) {\n    // fall back to unlabeled discovery\n    findUnlabeledPseudoRelocList(monitor);\n}","preventionTips":["Re-import unstripped PEs so both marker symbols survive.","Create the missing END label manually when only START is present.","Fall back to the unlabeled path when the labeled path throws."],"tags":["ghidra","analysis","mingw","symbol","invalid-data"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}