fix(libSceAgcDriver): report module-relative code offsets on macOS #5619

Closed
yripper wants to merge 1 commit from upstream-pr/5619 into main
yripper commented 2026-10-14 01:25:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by yripper on 2026-10-14T01:25:44Z.


What

ModuleOffset in the AGC driver's guest memory profiling turns sync and caller sites into module-relative offsets so the reports can be symbolized. On macOS it fell through to the generic path and printed absolute addresses, which change every run under ASLR. It now resolves the module base with dladdr, as the Windows path does with GetModuleHandleExA. Linux and Windows are unchanged.

Tested

macOS 26 on an M1 Pro, x86-64 build under Rosetta 2, with MoltenVK. Ran God of War: Sons of Sparta (PPSA28997) with APS5_PROFILE_DRAW=1: the sync and caller sites in the reports print module offsets instead of absolute addresses. Linux and Windows code paths are untouched (the change is inside #elif defined(__APPLE__)).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a (profiling output only)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4851635158 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5619). Originally posted by [yripper](https://github.com/yripper) on 2026-10-14T01:25:44Z. --- ### What `ModuleOffset` in the AGC driver's guest memory profiling turns sync and caller sites into module-relative offsets so the reports can be symbolized. On macOS it fell through to the generic path and printed absolute addresses, which change every run under ASLR. It now resolves the module base with `dladdr`, as the Windows path does with `GetModuleHandleExA`. Linux and Windows are unchanged. ### Tested macOS 26 on an M1 Pro, x86-64 build under Rosetta 2, with MoltenVK. Ran God of War: Sons of Sparta (PPSA28997) with `APS5_PROFILE_DRAW=1`: the sync and caller sites in the reports print module offsets instead of absolute addresses. Linux and Windows code paths are untouched (the change is inside `#elif defined(__APPLE__)`). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a (profiling output only) - [x] AI-assisted: yes
yripper commented 2026-10-14 22:46:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by yripper on 2026-10-14T22:46:54Z.


Closing for now so the guest arena PR that @mugurc asked for in #1 can be my one open pull request. I'll reopen this one after that is merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180193915 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5619#issuecomment-6180193915). Originally posted by [yripper](https://github.com/yripper) on 2026-10-14T22:46:54Z. --- Closing for now so the guest arena PR that @mugurc asked for in #1 can be my one open pull request. I'll reopen this one after that is merged.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5619
No description provided.