Skip to content

fix(build): link the fixed-base loader test with ld.bfd - #6870

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
adriadam10:fix/fixed-base-bfd
Oct 16, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
adriadam10:fix/fixed-base-bfd

Conversation

@adriadam10

Copy link
Copy Markdown
Collaborator

What

guest_dynamic_loader_fixed_base_tests, the only non-PIE executable in the tree, now links with -fuse-ld=bfd. Since #6863 the linux job links with wild 0.10.0, and this test aborts on every run there (main run 38918416732: _sceKernelRtldThreadAtexitDecrement: image holds no thread atexit reference, an exception that ThrowsRuntimeError expects to catch).

Cause: in a non-PIE executable GCC encodes the personality routine in .eh_frame as an absolute address (zPLR, encoding 0x03). For that address to be the same one libc.prx sees, the linker must give __gxx_personality_v0 a canonical PLT entry (a non-zero st_value on the undefined .dynsym symbol). wild 0.10.0 doesn't (wild-linker/wild#2469; fixed on wild's main by wild-linker/wild#2480 on 2026-09-02, not released yet). The personality pointer then names a local .plt.got stub, LibcUnwind::CallPersonality recognises neither __gxx_personality_v0 address, phase 1 fails and every exception is reported unhandled.

The same executable relinked by hand from the build's link command:

linker __gxx_personality_v0 in .dynsym personality in .eh_frame test
ld.bfd 0x4020a0 (canonical PLT) 0x4020a0 pass
LLD 23.1.1 0x204cd0 0x204cd0 pass
wild 0.10.0 0 0x403b70 (.plt.got stub) abort

Every other executable is PIE, where wild already creates the canonical entry (wild-linker/wild#2152); the full ctest with wild shows no other difference from ld.bfd. -fuse-ld=bfd is placed after the -B<wild> flag in the link line, and GCC then takes ld.bfd from PATH. Once a wild release has #2480, the option can go.

Tested

CachyOS, GCC 16.2.1, build configured like CI's linux job (-B dir with ld -> wild): without the change 0/40 runs pass; with it the link line has -B.../wild-0.10.0/bin ... -fuse-ld=bfd, __gxx_personality_v0 has st_value 0x4020a0, 20/20 runs pass.

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 (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: ci(linux): link with wild #6863 (merged)
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

wild 0.10.0 gives no canonical PLT entry to a DSO function whose address a
non-PIE executable takes (wild-linker/wild#2469, fixed after the release by
boykopovar#2480), so the absolute personality pointer in .eh_frame names a local stub
and every exception reaching main is unhandled.

Co-Authored-By: Claude <noreply@anthropic.com>
@adriadam10
adriadam10 merged commit 4524944 into boykopovar:main Oct 16, 2026
9 checks passed
fable-void added a commit to fable-void/AnyPS5 that referenced this pull request Oct 18, 2026
Merge upstream main at 4524944 (Merge pull request boykopovar#6870) into
the new GPU path.

Conflicts: 157 files with 158 entries: 136 content, 17 modify/delete,
4 add/add and 1 rename collision.

The new path keeps its structure. The dispatch cache, draw cache, draw
capture, write evidence and CPU shader-memory capture stay deleted, and
the upstream mechanisms built on them are not taken: pipelined queue-0
work, dispatches resolved ahead, draw relocation, the pipeline journal,
snapshot and capture reuse, sparse dma-buf imports and import settling.
Upstream correctness and shader fixes are kept where they apply to the
new path.

Upstream tests dropped: 84 (18 whole files, 2 file versions and 64
functions or checks). Upstream rules listed for carrying to the new
path: 27.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant