ARTICLE DETAIL

资讯详情

深耕郑州网站建设与运营推广的一线实战洞察。

AnyPS5 relinker报错怎么办?10种常见错误场景与退出码排查清单

AnyPS5 relinker报错怎么办?10种常见错误场景与退出码排查清单 AnyPS5 relinker报错怎么办10种常见错误场景与退出码排查清单【免费下载链接】AnyPS5Tool for automatic PS5 executables porting to Linux and Windows项目地址: https://gitcode.com/GitHub_Trending/an/AnyPS5AnyPS5 是一款将 PS5 可执行文件自动移植到 Linux 和 Windows 的开源工具其中的 relinker 组件负责把 ELF 可执行文件重写为目标平台的原生格式。转换失败时relinker 会在标准错误输出FAIL: 错误信息并以特定退出码退出。本文整理了10 种常见报错场景和一份退出码速查表帮你快速定位问题、一次修好。退出码速查30秒看懂 relinker 的退出状态排查前先记住三个数字源码见 core/relinker/main.cpp退出码含义去哪里找原因0转换成功—1命令行参数不合法检查 relinker 的调用参数2转换失败stderr 中的FAIL:行常带(offset 0x…)其他使用了--autorun时这是启动的程序的退出码见运行期问题排查 小技巧转换失败时offset 0x…指向出错字节在输入文件中的位置把它报给项目维护者或对照自己的反汇编能大幅缩短排查时间。场景1unknown option 或 unexpected argument退出码 1报错样式FAIL: unknown option: --windos FAIL: unexpected argument: extra.elf原因拼错参数、多写了参数或把unused-filter写成了--unused-filter。解决方法对照 docs/user/USAGE.md 的选项表逐个核对拼写注意unused-filter0|1|2不带--前缀且只能出现一次relinker 没有--help标志不带任何参数运行即可打印用法参数解析逻辑在 core/relinker/cli/src/CliArgs.cpp。场景2参数组合冲突退出码 1报错样式FAIL: --windows-diagnostics requires --windows FAIL: --exclude-sce-module conflicts with --skip-sce-module FAIL: unused-filter must be specified once with a value of 0, 1 or 2原因--windows-diagnostics和--windows-gui必须搭配--windows--skip-sce-module与--exclude-sce-module互斥。解决方法删掉冲突的选项。同时注意--skip-sce-module、--exclude-sce-module、--skip-syscall-check、--lazy-binding均已弃用文档明确说明它们只用于调试游戏带这些标志运行会极不稳定。场景3The input is a SELF container, not an ELF退出码 2报错样式FAIL: The input is a SELF container, not an ELF原因你直接把 PS5 光盘镜像里加密的.elfSELF 封装喂给了 relinker。relinker 要求的是已解密的干净 ELF检测逻辑在 core/relinker/relinker/src/parsing/ElfReader.cpp。解决方法先通过你已有的 SELF 解密流程拿到明文 ELF再运行 relinker。场景4Invalid ELF magic number退出码 2报错样式FAIL: Invalid ELF magic number: 50 4b 03 04原因输入文件不是 ELF。括号里的 4 字节是文件头的实际魔数例如50 4b 03 04是 ZIP 格式——你可能拷错了文件。解决方法确认输入是 PS5 主程序对应的 ELF而不是压缩包、图标或其他资源若文件过小还会报File too small for ELF header同样是拿错了文件场景5sce_module 目录缺失退出码 2报错样式FAIL: sce_module/sce_modules/prx was not found beside the input executable: /path/to/source. Use --skip-sce-module only if this game can run without these modules.原因relinker 要求在游戏自带的 ELF 模块目录sce_module/或sce_modules/、prx/与输入文件同目录存在。正确布局参考 docs/user/USAGE.mdsource/ input.elf sce_module/ bundled ELF modules解决方法把游戏文件按上述布局重新组织。除非你确定该游戏没有捆绑模块否则不要使用已弃用的--skip-sce-module绕过源码见 core/relinker/relinker/src/guest/GuestModuleBuilder.cpp。场景6sce_module 与 sce_modules 同时存在退出码 2报错样式FAIL: Both sce_module and sce_modules exist beside the input executable原因单数目录sce_module/和复数目录sce_modules/二选一不能同时存在。解决方法只保留其中一个目录名把模块都放进去再重新转换。场景7--to-intel 指令转换失败退出码 2报错样式FAIL: AMD-only instruction without Intel lowering: VPERMPD (offset 0x8a2f3c) FAIL: AMD-only instruction too short for a jump and not followed by an instruction (offset 0x...)原因--to-intel用于把 AMD 专有指令替换成 Intel 兼容序列。遇到没有替换方案的指令VPERMPD、部分 SHA/CLZERO 指令等时直接报错相关实现在 core/relinker/codegen/src/Amd64OnlyConverter.cpp。解决方法去掉--to-intel仅在 Intel CPU 上运行游戏时才有必要加它确认输入确实是 AMD Zen 架构的可执行文件AMD 平台上保持默认即可场景8Windows 目标专属错误退出码 2常见报错FAIL: Windows output requires a little-endian ELF64 x86-64 image FAIL: Windows output requires a position-independent ELF image FAIL: No PT_LOAD segments found FAIL: Invalid Windows icon PNG …/sce_sys/icon0.png: …原因与解决检测逻辑在 core/relinker/elfpatcher/src/windows/WindowsLoadImage.cpp架构不对输入不是 x86-64 位置无关 ELF——确认输入是 64 位可执行文件图标损坏--windows模式会读取输入同目录下sce_sys/icon0.png作为 EXE 图标换成一张正常的 PNG≥64x64另外注意一个警告输出名以.exe结尾但没加--windows时产物仍是 Linux ELF 可执行文件——.exe后缀不会自动选择 Windows 输出务必显式加--windows场景9Guest 模块依赖错误退出码 2常见报错FAIL: Cyclic guest initialization dependency: sce_module/libX.elf FAIL: Duplicate guest export after stripping #: … in … and … FAIL: Guest output would overwrite an input module: … FAIL: Guest modules require eager binding; --lazy-binding is incompatible原因与解决循环依赖游戏自带模块之间初始化成环属于游戏自身结构问题目前无法通过参数修复重复导出两个模块导出了同名符号检查sce_module/下是否混入了重复文件输出覆盖输入输出路径恰好落在输入模块或输入可执行文件上换一个输出文件名--lazy-binding冲突带捆绑模块时必须用默认的 eager binding去掉--lazy-binding场景10Code analysis 失败退出码 2带 offset常见报错FAIL: Code analysis: invalid dynamic segment (offset 0x…) FAIL: Code analysis: no code entry points (offset 0x…) FAIL: Code analysis: function exceeds executable segment (offset 0x…)原因relinker 对代码段做控制流/重定位分析时发现输入 ELF 的结构不符合预期dynamic 段未终止、函数范围越界等见 core/relinker/relinker/src/analysis/CodeInstructionCollector.cpp。这通常意味着输入文件被裁剪、重打包或损坏不是 relinker 的选项问题。解决方法换一个来源重新提取完整 ELF确认文件未被手动修改过若换来源后仍报错把完整 stderr 和 offset 信息反馈给项目维护者转换成功但游戏跑不起来转换阶段和运行阶段是两回事--autorun会在转换成功后直接启动产物此时退出码是游戏自己的显示Raw exit code / Unpacked见 core/relinker/cli/src/Autorun.cpp退出码非 0 不等于转换失败运行失败大多与目录布局有关产物旁边必须有libs/*.prx从build/core/libs/libs/拷贝对应平台版本和app0/游戏资源转换结束时 relinker 会打印期望布局照着装即可已验证可玩的游戏清单见 docs/user/COMPATIBILITY.md手柄/键鼠映射问题见 docs/user/INPUT_MAPPING.md构建产物本身出问题relinker 二进制没有/过旧重新按 docs/dev/BUILD.md 构建排查清单按顺序过一遍✅ 退出码是1还是21改参数2看FAIL:信息✅ 输入是否为解密的干净 ELF非 SELF、非压缩包✅sce_module/或sce_modules//prx/与输入同目录存在且没有单复数并存✅ 参数拼写正确unused-filter不带--选项不冲突✅ 目标 Windows 时显式加了--windows且输入为 x86-64 位置无关 ELF✅ 产物旁按提示摆放了libs/与app0/运行布局✅ 仍失败记下错误信息与 offset反馈给项目维护者按照这份清单排查绝大多数 relinker 报错都能在第 14 步内解决。祝移植顺利 相关文档用法与选项表docs/user/USAGE.md入口与退出码逻辑core/relinker/main.cpp参数解析core/relinker/cli/src/CliArgs.cppELF 输入校验core/relinker/relinker/src/parsing/ElfReader.cpp构建指南docs/dev/BUILD.md【免费下载链接】AnyPS5Tool for automatic PS5 executables porting to Linux and Windows项目地址: https://gitcode.com/GitHub_Trending/an/AnyPS5创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表