Skip to content

fix(relinker): read LSDA call-site tables only under a personality routine - #1944

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
babyhuey:fix/relinker-lsda-without-personality
Oct 10, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
babyhuey:fix/relinker-lsda-without-personality

Conversation

@babyhuey

@babyhuey babyhuey commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What

EhFrameReader reads an FDE's LSDA as an Itanium C++ call-site table only when its CIE names a personality routine (P in the augmentation). An LSDA under a CIE without one is skipped.

The C++ LSDA format is defined by the personality routine that reads it. With no personality the unwinder never consults the LSDA, so its contents need not be a C++ table. .NET NativeAOT writes exactly this: every CIE is zLR, and each LSDA points at the runtime's own EH info, which its runtime reads instead of a C++ personality routine. Its catch and finally funclets are separate functions with their own FDEs, so no code is lost by not reading these LSDAs.

Three catalog titles are C# NativeAOT builds (System.Private.CoreLib in the executable) and fail to relink with --windows on main:

  • PPSA99109 Prospero Explorer: FAIL: Strict filter: LSDA call-site table size mismatch (offset 0x1f5950)
  • PPSA99110 Prospero Multi Tools: the same, at 0x1ffd0b
  • PPSA99920 Prospero Vibrate: the same, at 0x153c03

In these three, every CIE is zLR, and 4474, 4699 and 2731 of their LSDAs respectively do not parse as call-site tables. The 38 other catalog titles I could relink use only zPLR CIEs, and all of their roughly 65,000 LSDAs parse as call-site tables, so this change does not affect them.

exceptionLandingPads used a zLR CIE to exercise call-site parsing. It now uses zPLR, with the personality as an extra target. The new exceptionDataWithoutPersonality checks that an LSDA that is not a call-site table, under a zLR CIE, is accepted and adds no targets.

Tested

Linux (Ubuntu 24.04, GCC 13, Release, ANYPS5_RELINKER_ONLY=ON): all 38 relinker tests pass. strict_nid_filter fails when the personality check is removed. The three titles above now relink with --windows (exit 0); Linux output was already unaffected. check_conventions.py passes. Windows: not run with this branch; the failure and its absence are both in the relinker, which I ran on Linux with --windows.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

@babyhuey

babyhuey commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Windows run of the three titles. Windows 11, RTX 3080, WinLibs GCC 15.2.0 r7, Release, main f145139 with this branch (and my other open PRs) merged; relinked with --windows and run.

Title main with this branch
PPSA99109 Prospero Explorer FAIL: Strict filter: LSDA call-site table size mismatch (offset 0x1f5950) relinks; stops loading libSceZlib.prx, which no module provides
PPSA99110 Prospero Multi Tools FAIL: Strict filter: LSDA call-site table size mismatch (offset 0x1ffd0b) relinks; FAIL: unresolved ELF import JZKw5+Wrnaw from libkernel.prx (pthread_sigmask)
PPSA99920 Prospero Vibrate FAIL: Strict filter: LSDA call-site table size mismatch (offset 0x153c03) relinks; FAIL: unresolved ELF import JZKw5+Wrnaw from libkernel.prx (pthread_sigmask)

@babyhuey babyhuey mentioned this pull request Oct 9, 2026
9 tasks done

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full diff against current main. The change is narrowly scoped to avoid parsing an LSDA as a C++ call-site table when its CIE has no personality routine; the fixture now explicitly covers both the personality and no-personality cases. I built the relinker-only configuration on Linux and ran all 38 CTests successfully, including strict_nid_filter. Conventions and diff checks pass, and the author has supplied Windows evidence for the three reported NativeAOT cases. The upstream workflow is not yet reported for this head, so normal CI evidence remains outstanding.

@babyhuey

babyhuey commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Fork CI for this head (547b458) while the upstream run waits for approval: Build run, all jobs green (Linux, Windows, relinker on Linux, macOS and Windows).

@danielradosa

Copy link
Copy Markdown
Contributor

Windows run with a title for this PR. Prospero Vibrate PPSA99920 1.0 (catalog release, sha256 as in the record, eboot.bin and sce_module/libc.prx unwrapped from their SELF containers), Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release.

AI-assisted: yes (Claude Code).

@babyhuey
babyhuey force-pushed the fix/relinker-lsda-without-personality branch 3 times, most recently from e91cb0d to 93d7113 Compare October 9, 2026 23:30
@babyhuey
babyhuey force-pushed the fix/relinker-lsda-without-personality branch from 93d7113 to c970ca7 Compare October 10, 2026 01:23
oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 10, 2026
@oneandonlydean
oneandonlydean merged commit 9992a5d into boykopovar:main Oct 10, 2026
9 checks passed
SleglJan pushed a commit to SleglJan/AnyPS5 that referenced this pull request Oct 10, 2026
…thout-personality

fix(relinker): read LSDA call-site tables only under a personality routine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants