loader: skip R_X86_64_NONE relocations #1534
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1534
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1534/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Nawid3333 on GitHub · 2026-10-15 18:48 UTC · original
Nawid3333:loader/skip-r-x86-64-none→main· +33 −0 · 4 files · 1 commits · closed without mergingHello Kitty Island Adventure (PPSA18176) stops while it loads
Media/Modules/PS5Util.prxwithsceKernelLoadStartModule(#610).eboot.bin,libc.prxandlibSceNpCppWebApi.prxrelocate fine; the relocation pass overPS5Util.prxends with (line numbers from build719e025):That module has a relocation entry of type 0,
R_X86_64_NONE. It is a no-op: the x86-64 ABI defines no computation for it, and FreeBSD's rtld skips it (reloc.c).GetRelocationInfostill has no case for it at9e41d832and ends indefault: EXIT("unknown type: %d\n", ...).RelocateRecordnow returns true for such an entry before resolving anything, so the entry is marked done inrela_bitsand nothing is written. AcaseinGetRelocationInfoalone would not be enough: the entry would come back unresolved, get a stub, and the stub address would be written atbase_vaddr + r_offset, over the module's first 8 bytes whenr_offsetis 0.This is #1146 by @NevesHenry (cause found by @tucubanit0 in #610), the same patch (identical patch-id), applied to
9e41d832without conflicts. #1146 was based ond2413fc2; the only upstream commit touchingruntimeLinker.cppsince then,cb375ec3(LoadExec), doesn't touch the relocation code. #1146 was closed on 2026-10-08, two days before the README asked PRs to name the game they fix (947627d1); the bug still stops this game, so I'm sending it again. If #1146 was closed on purpose, tell me and I'll close this one.Testing (Windows 11, clang-cl 19.1.5, Release; tree:
9e41d832+ this commit):TestRelocationSkipsNoneEntries(tests/VirtualMemoryAllocationTests.cpp, CTestvirtual_memory_allocation): a type-0 entry at offset 0 leaves the module's first word unchanged, and anR_X86_64_RELATIVEentry next to it is still applied. It passes; with the early return removed, the test program exits withunknown type: 0, the error from #610.shader_cfg,resource_tracking,resource_materialization,scalar_provenance,shader_vertex_metadata,lru_cache,ime_dialog,audio_out2_port,pad_hapticsandcontroller_settingsstill pass.9e41d832on Linux and Windows because two test files don't build (run; the last green run wasdf5b9b92). #1504 fixes that, so this PR's own CI will be red until it lands. CI on my fork for this commit with #1504 on top: green on Windows, Linux and macOS,virtual_memory_allocationpasses on all three: https://github.com/Nawid3333/KytyPS5/actions/runs/38785275527AI use (per the README's AI policy): the commit is NevesHenry's and was written with Claude, per its trailer. For this resubmission Claude Code (Anthropic) re-applied it, ran the checks above on my machine and wrote this description.
@coderabbitai[bot] on GitHub · 2026-10-15 18:51 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
a255ceb8-16d8-4e3b-803d-12387f5d578e📥 Commits
Reviewing files that changed from the base of the PR and between
9e41d8320aand21c8605f5a.📒 Files selected for processing: 4
src/loader/elf.hsrc/loader/runtimeLinker.cppsrc/loader/runtimeLinker.htests/VirtualMemoryAllocationTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
The loader defines
R_X86_64_NONEand treats entries of this type as successful without resolving or patching their targets. A new test checks that a NONE target remains unchanged and a RELATIVE target is updated. The test is registered in the standard virtual-memory allocation test sequence.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
21c86The change appears to implement the intended no-op relocation behavior and includes a regression test. No actionable merge risk is identified from the supplied evidence.
Pre-merge checks:
4 ·
1
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@Nmzik on GitHub · 2026-10-15 20:47 UTC · original
That bug was closed on purpose. The game dump is invalid
@Nawid3333 on GitHub · 2026-10-15 20:48 UTC · original
oh did not see that ok
@Nawid3333 on GitHub · 2026-10-15 20:52 UTC · original
Any thing i can focus on i have time this weekend @Nmzik
@Nmzik on GitHub · 2026-10-16 01:15 UTC · original
@Nawid3333 If you have a spare time would you be able to look at shader opcodes. Maybe we can emit less instructions for some of them while still preserving correctness (just an idea)
@Nawid3333 on GitHub · 2026-10-20 19:39 UTC · original
@nmzik A short update and a question. After your idea here I opened five "fewer instructions" PRs (#1554, #1565, #1566, #1567, #1568).
Right now I'm working on:
What I can provide: tests on Windows with an RX 9070 XT, measured game runs, full GPU test suite runs, and hardware-exact opcode fixes with tests.
What would help you most right now? And please close any of my open PRs you don't need; I'd rather have a few useful ones than many open.
Pull request closed