feat(relinker): load Linux executables at a fixed base #4593

Merged
Recapi merged 3 commits from upstream-pr/4593 into main 2026-10-14 11:56:08 +00:00
Recapi commented 2026-10-12 16:26:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-12T16:26:54Z.


What

Linux side of #4013, the counterpart of #4140's --windows-fixed-base. Ruffle (PPSA68091), VLC (PPSA85300) and XPSemu (PPSA97358) read GOT slots at offset + 0x400000, where each offset comes from app0/imports.txt, so they assume the console's load address. The relinked Linux executable is a PIE loaded at 0x555555554000, and the first read faults.

The relinker option. relinker --linux-fixed-base <address> writes the executable as ET_EXEC and adds the address to every virtual address it holds, so virtual address 0 lands at the address, as on the console:

  • program headers, except PT_NULL and PT_GNU_STACK;
  • the entry;
  • the address tags of the dynamic table (DT_STRTAB, DT_SYMTAB, DT_HASH, DT_RELA, DT_JMPREL, DT_PLTGOT);
  • every relocation offset;
  • the addends of R_X86_64_RELATIVE and R_X86_64_IRELATIVE, which ld.so no longer adds a load bias to;
  • defined symbols. Undefined, SHN_ABS and STT_TLS symbols stay unchanged.

It throws instead of writing an image that would not load:

  • a relocation type outside the ones the Linux output uses;
  • a RELATIVE target below the image;
  • a dynamic entry other than DT_NEEDED in the executable's dependency table;
  • a base that is not a multiple of a PT_LOAD alignment;
  • an image that would end past the 47-bit user address space.

The CLI takes a 64 KiB-aligned address from 0x10000 through 0x7fffffff0000, in decimal or hexadecimal, and rejects the option with --windows, --macos or --lazy-binding. Lazy binding would need the PLT slots' initial contents rebased, and it is deprecated. Bundled guest modules keep their normal placement. Without the option the output is unchanged: the DOOM catalog executable relinks byte for byte the same as with main's relinker.

The libkernel fix. dlsym in the default scope recognized the main program by comparing dladdr's dli_fbase with dl_iterate_phdr's dlpi_addr. For an ET_EXEC image these differ: dlpi_addr is 0 and dli_fbase is the image's first page, so symbols of a non-PIE executable were not found. It now compares link maps, taken from dladdr1(RTLD_DL_LINKMAP) and dlinfo(dlopen(NULL), RTLD_DI_LINKMAP).

Tested

Linux (Ubuntu, GCC, Release, NVIDIA RTX 2080 SUPER) on main d592d54:

  • Ruffle (PPSA68091), catalog build with sce_module/libc.prx unwrapped:
    • main: SIGSEGV at cmpq $0x0,0x400000(%rax), rax = 0x24d5370, as in #4013.
    • --registry --linux-fixed-base 0x400000: the output is ET_EXEC with entry 0x2d8ecd0 (0x298ecd0 + 0x400000). The import check passes, and the title opens VideoOut, builds its shaders and renders, then stops at an unrelated AGC limit: only normal color rendering with copy ROP is supported (CB_COLOR_CONTROL 0x00cc0050, mode FMASK decompress).
  • New linux_fixed_base test:
    • relinks a fixture with and without the option and compares every program header, the entry, every dynamic tag and the relocation table;
    • runs the fixed output, whose code checks that it runs at 0x400000 + entry and that its RELATIVE slot holds that address (SIGTRAP on success);
    • checks the errors for an unaligned base, an image past the user address space, an unsupported relocation type and a negative RELATIVE target.
  • linux_executable_exports now also runs at a fixed base, where dlsym(RTLD_DEFAULT) from a needed library resolves an executable export. Without the symbol rebasing it fails with SIGSEGV.
  • New guest_dynamic_loader_fixed_base: GuestDynamicLoader.cpp built with -no-pie. Before the libkernel fix it aborts (sceKernelDlsym(0, GuestDefaultScopeOnly) misses the executable symbol); after the fix it passes.
  • cli_args covers parsing, the range, alignment, malformed values, repetition and the conflicts.
  • Full suite: ctest 959/959. check_conventions.py and check_test_registration.py pass.
  • Fork CI: green on Linux, Windows and macOS (run 38273228109). linux_fixed_base, guest_dynamic_loader_fixed_base, linux_executable_exports and cli_args pass on Linux. The branch merges cleanly onto current main 2a5eca1.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4832202260 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593). Originally posted by [Recapi](https://github.com/Recapi) on 2026-10-12T16:26:54Z. --- ### What Linux side of #4013, the counterpart of #4140's `--windows-fixed-base`. Ruffle (PPSA68091), VLC (PPSA85300) and XPSemu (PPSA97358) read GOT slots at `offset + 0x400000`, where each offset comes from `app0/imports.txt`, so they assume the console's load address. The relinked Linux executable is a PIE loaded at `0x555555554000`, and the first read faults. **The relinker option.** `relinker --linux-fixed-base <address>` writes the executable as `ET_EXEC` and adds the address to every virtual address it holds, so virtual address 0 lands at the address, as on the console: - program headers, except `PT_NULL` and `PT_GNU_STACK`; - the entry; - the address tags of the dynamic table (`DT_STRTAB`, `DT_SYMTAB`, `DT_HASH`, `DT_RELA`, `DT_JMPREL`, `DT_PLTGOT`); - every relocation offset; - the addends of `R_X86_64_RELATIVE` and `R_X86_64_IRELATIVE`, which `ld.so` no longer adds a load bias to; - defined symbols. Undefined, `SHN_ABS` and `STT_TLS` symbols stay unchanged. It throws instead of writing an image that would not load: - a relocation type outside the ones the Linux output uses; - a `RELATIVE` target below the image; - a dynamic entry other than `DT_NEEDED` in the executable's dependency table; - a base that is not a multiple of a `PT_LOAD` alignment; - an image that would end past the 47-bit user address space. The CLI takes a 64 KiB-aligned address from `0x10000` through `0x7fffffff0000`, in decimal or hexadecimal, and rejects the option with `--windows`, `--macos` or `--lazy-binding`. Lazy binding would need the PLT slots' initial contents rebased, and it is deprecated. Bundled guest modules keep their normal placement. Without the option the output is unchanged: the DOOM catalog executable relinks byte for byte the same as with `main`'s relinker. **The libkernel fix.** `dlsym` in the default scope recognized the main program by comparing `dladdr`'s `dli_fbase` with `dl_iterate_phdr`'s `dlpi_addr`. For an `ET_EXEC` image these differ: `dlpi_addr` is 0 and `dli_fbase` is the image's first page, so symbols of a non-PIE executable were not found. It now compares link maps, taken from `dladdr1(RTLD_DL_LINKMAP)` and `dlinfo(dlopen(NULL), RTLD_DI_LINKMAP)`. ### Tested Linux (Ubuntu, GCC, Release, NVIDIA RTX 2080 SUPER) on `main` d592d54: - **Ruffle (PPSA68091)**, catalog build with `sce_module/libc.prx` unwrapped: - `main`: `SIGSEGV` at `cmpq $0x0,0x400000(%rax)`, `rax` = 0x24d5370, as in #4013. - `--registry --linux-fixed-base 0x400000`: the output is `ET_EXEC` with entry 0x2d8ecd0 (0x298ecd0 + 0x400000). The import check passes, and the title opens VideoOut, builds its shaders and renders, then stops at an unrelated AGC limit: `only normal color rendering with copy ROP is supported (CB_COLOR_CONTROL 0x00cc0050, mode FMASK decompress)`. - **New `linux_fixed_base` test:** - relinks a fixture with and without the option and compares every program header, the entry, every dynamic tag and the relocation table; - runs the fixed output, whose code checks that it runs at `0x400000 + entry` and that its `RELATIVE` slot holds that address (`SIGTRAP` on success); - checks the errors for an unaligned base, an image past the user address space, an unsupported relocation type and a negative `RELATIVE` target. - **`linux_executable_exports`** now also runs at a fixed base, where `dlsym(RTLD_DEFAULT)` from a needed library resolves an executable export. Without the symbol rebasing it fails with `SIGSEGV`. - **New `guest_dynamic_loader_fixed_base`**: `GuestDynamicLoader.cpp` built with `-no-pie`. Before the libkernel fix it aborts (`sceKernelDlsym(0, GuestDefaultScopeOnly)` misses the executable symbol); after the fix it passes. - **`cli_args`** covers parsing, the range, alignment, malformed values, repetition and the conflicts. - **Full suite:** ctest 959/959. `check_conventions.py` and `check_test_registration.py` pass. - **Fork CI:** green on Linux, Windows and macOS ([run 38273228109](https://github.com/Recapi/AnyPS5/actions/runs/38273228109)). `linux_fixed_base`, `guest_dynamic_loader_fixed_base`, `linux_executable_exports` and `cli_args` pass on Linux. The branch merges cleanly onto current `main` 2a5eca1. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
Recapi commented 2026-10-12 16:40:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-12T16:40:18Z.


The overlap check on #4140 lists this PR. The two only touch the same lines: both add an option to Cli.hpp, CliArgs.cpp (the usage string and the parser), CliArgsTests.cpp and the USAGE.md table. The code paths are separate: #4140 changes the Windows PE writer, and this PR changes the Linux ELF patcher and libkernel's dlsym. Neither depends on the other, and whichever lands second needs only a mechanical rebase. I'll do it here if #4140 goes first. @veosett, I'm happy to rebase on yours or follow your parsing style if you prefer one address parser for both options.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128526845 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6128526845). Originally posted by [Recapi](https://github.com/Recapi) on 2026-10-12T16:40:18Z. --- The overlap check on #4140 lists this PR. The two only touch the same lines: both add an option to `Cli.hpp`, `CliArgs.cpp` (the usage string and the parser), `CliArgsTests.cpp` and the `USAGE.md` table. The code paths are separate: #4140 changes the Windows PE writer, and this PR changes the Linux ELF patcher and libkernel's `dlsym`. Neither depends on the other, and whichever lands second needs only a mechanical rebase. I'll do it here if #4140 goes first. @veosett, I'm happy to rebase on yours or follow your parsing style if you prefer one address parser for both options.
Recapi commented 2026-10-12 18:53:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-12T18:53:12Z.


Rebased onto main 1acfa7f. The only conflict was an #include in DynamicLoader.cpp, where main had dropped <set>. After the rebase on Linux: ctest 973/973, and check_conventions.py and check_test_registration.py pass.

More from Ruffle (PPSA68091) with --linux-fixed-base 0x400000, with this PR on main 1acfa7f:

  • Logging. The title now redirects its output into /data/ruffle/ruffle.log (dup2, #2478), so the run shows up there.
  • Without the option, the same build still stops with SIGSEGV right after can't write /data/ruffle/ruffle.log.
  • With it, the game library UI runs: the display, pad, keyboard, mouse and audio initialize, it reports [Library] 0 games and presents 2,400 frames in 60 s. It ran until the timeout.
  • Opening Favorites starts the Flash player (wgpu renderer). Its first pass throws only normal color rendering with copy ROP is supported (CB_COLOR_CONTROL 0x00cc0050, mode FMASK decompress). That is AGC and outside this PR; I'm looking at it separately.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6130594280 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6130594280). Originally posted by [Recapi](https://github.com/Recapi) on 2026-10-12T18:53:12Z. --- Rebased onto `main` 1acfa7f. The only conflict was an `#include` in `DynamicLoader.cpp`, where `main` had dropped `<set>`. After the rebase on Linux: ctest 973/973, and `check_conventions.py` and `check_test_registration.py` pass. More from Ruffle (PPSA68091) with `--linux-fixed-base 0x400000`, with this PR on `main` 1acfa7f: - **Logging.** The title now redirects its output into `/data/ruffle/ruffle.log` (`dup2`, #2478), so the run shows up there. - **Without the option**, the same build still stops with `SIGSEGV` right after `can't write /data/ruffle/ruffle.log`. - **With it**, the game library UI runs: the display, pad, keyboard, mouse and audio initialize, it reports `[Library] 0 games` and presents 2,400 frames in 60 s. It ran until the timeout. - **Opening Favorites** starts the Flash player (wgpu renderer). Its first pass throws `only normal color rendering with copy ROP is supported (CB_COLOR_CONTROL 0x00cc0050, mode FMASK decompress)`. That is AGC and outside this PR; I'm looking at it separately.
ee6aba54 commented 2026-10-12 19:25:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ee6aba54 on 2026-10-12T19:25:25Z.


Tested on Linux with PPSA15304 (engine: Unreal Engine 5), a second case besides #4013 that needs the console's load address. Its bundled libc.prx creates a "Low Address Malloc" mspace over a static buffer inside the executable and rejects a base outside the application area 0x200000000..0xFC00000000. With the PIE at 0x555555554000 the creation returns NULL, and the title faults in its global constructors before main. #3043 describes the same check on Windows.

  • --registry --linux-fixed-base 0x400000000 on head 03dd25f99: the output is ET_EXEC, and its relocations (1,300,490 RELATIVE, 2,430 R_X86_64_64, 19 GLOB_DAT) match, in offset and addend, those of an image rebased by hand to the same address.
  • Run with the libraries of this branch merged with #3763, #4500 and #4586 (Ubuntu 24.04, GCC 13.3, Release, RTX 5080): the mspace is created, the title starts and reaches its main menu.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6131106744 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6131106744). Originally posted by [ee6aba54](https://github.com/ee6aba54) on 2026-10-12T19:25:25Z. --- Tested on Linux with PPSA15304 (engine: Unreal Engine 5), a second case besides #4013 that needs the console's load address. Its bundled `libc.prx` creates a "Low Address Malloc" mspace over a static buffer inside the executable and rejects a base outside the application area `0x200000000..0xFC00000000`. With the PIE at `0x555555554000` the creation returns NULL, and the title faults in its global constructors before `main`. #3043 describes the same check on Windows. - `--registry --linux-fixed-base 0x400000000` on head `03dd25f99`: the output is `ET_EXEC`, and its relocations (1,300,490 `RELATIVE`, 2,430 `R_X86_64_64`, 19 `GLOB_DAT`) match, in offset and addend, those of an image rebased by hand to the same address. - Run with the libraries of this branch merged with #3763, #4500 and #4586 (Ubuntu 24.04, GCC 13.3, Release, RTX 5080): the mspace is created, the title starts and reaches its main menu.
Recapi commented 2026-10-12 20:16:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-12T20:16:52Z.


Thanks @ee6aba54, that's a good second case. It also exercises a base above 4 GiB (0x400000000), where the image has to fit the console's application area rather than 0x400000. It's good to know the 1.3M RELATIVE relocations match a hand-rebased image.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6131892272 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6131892272). Originally posted by [Recapi](https://github.com/Recapi) on 2026-10-12T20:16:52Z. --- Thanks @ee6aba54, that's a good second case. It also exercises a base above 4 GiB (`0x400000000`), where the image has to fit the console's application area rather than `0x400000`. It's good to know the 1.3M `RELATIVE` relocations match a hand-rebased image.
Recapi commented 2026-10-13 10:40:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-13T10:40:20Z.


Rebased onto main c7632f036; new head 4fd9e6ea7.

The conflicts were in the CLI usage string and main.cpp. Current main moved image conversion into Relinker::Conversion, so the fixed-base option now passes through ConversionOptions::LinuxFixedBase to the Linux patcher there. The new --executable support and conversion progress are retained; bundled PRX modules keep their normal placement.

Verification on Linux, GCC 15, Release, NVIDIA RTX 2080 SUPER:

  • Full build succeeds after updating main's submodules.
  • Full CTest: 1,023 passed, 7 skipped, no failures (1,030 registered). linux_fixed_base, linux_executable_exports, relinker_conversion, relinker_executables, cli_args, guest_dynamic_loader and guest_dynamic_loader_fixed_base all pass.
  • Added a conversion-API regression case with a base above 4 GiB (0x400000000): ET_EXEC and rebased entry, bundled module bytes unchanged; non-Linux targets reject the option.
  • A separate CLI smoke with --linux-fixed-base 0x400000 --executable other.bin produces both executables as ET_EXEC at 0x400000, with the bundled module still ET_DYN.
  • Ruffle (PPSA68091, catalog 1.2.0), relinked with --registry --linux-fixed-base 0x400000 and the rebuilt libraries, ran for 40 s until timeout (exit 124). Its log records 3,000 presented frames, [Ruffle] Player started, the game loop, and a return to the library. Quality remains Low (quality=0), the workaround for #4685; this is not a claim of MSAA support or gameplay with an external SWF.
  • Conventions and test-registration checks pass.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143734997 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6143734997). Originally posted by [Recapi](https://github.com/Recapi) on 2026-10-13T10:40:20Z. --- Rebased onto `main` c7632f036; new head `4fd9e6ea7`. The conflicts were in the CLI usage string and `main.cpp`. Current main moved image conversion into `Relinker::Conversion`, so the fixed-base option now passes through `ConversionOptions::LinuxFixedBase` to the Linux patcher there. The new `--executable` support and conversion progress are retained; bundled PRX modules keep their normal placement. Verification on Linux, GCC 15, Release, NVIDIA RTX 2080 SUPER: - Full build succeeds after updating main's submodules. - Full CTest: 1,023 passed, 7 skipped, no failures (1,030 registered). `linux_fixed_base`, `linux_executable_exports`, `relinker_conversion`, `relinker_executables`, `cli_args`, `guest_dynamic_loader` and `guest_dynamic_loader_fixed_base` all pass. - Added a conversion-API regression case with a base above 4 GiB (`0x400000000`): ET_EXEC and rebased entry, bundled module bytes unchanged; non-Linux targets reject the option. - A separate CLI smoke with `--linux-fixed-base 0x400000 --executable other.bin` produces both executables as ET_EXEC at `0x400000`, with the bundled module still ET_DYN. - Ruffle (PPSA68091, catalog 1.2.0), relinked with `--registry --linux-fixed-base 0x400000` and the rebuilt libraries, ran for 40 s until timeout (exit 124). Its log records 3,000 presented frames, `[Ruffle] Player started`, the game loop, and a return to the library. Quality remains Low (`quality=0`), the workaround for #4685; this is not a claim of MSAA support or gameplay with an external SWF. - Conventions and test-registration checks pass.
Recapi commented 2026-10-13 11:40:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-13T11:40:03Z.


Updated the base again to main e99a1b0aa (41 more main commits); new head 5e7471794. This rebase applied without conflicts and adds no new feature changes. Full Linux Release build succeeds; CTest has 1,031 passed, 8 skipped, no failures (1,039 registered). Conventions and test-registration checks pass. Ruffle (PPSA68091, catalog 1.2.0), freshly relinked with --registry --linux-fixed-base 0x400000 and the rebuilt libraries, runs its library UI for 30 s until timeout (exit 124), logging 2,400 presented frames. The Flash player was not entered in this run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6144716714 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6144716714). Originally posted by [Recapi](https://github.com/Recapi) on 2026-10-13T11:40:03Z. --- Updated the base again to `main` e99a1b0aa (41 more main commits); new head `5e7471794`. This rebase applied without conflicts and adds no new feature changes. Full Linux Release build succeeds; CTest has 1,031 passed, 8 skipped, no failures (1,039 registered). Conventions and test-registration checks pass. Ruffle (PPSA68091, catalog 1.2.0), freshly relinked with `--registry --linux-fixed-base 0x400000` and the rebuilt libraries, runs its library UI for 30 s until timeout (exit 124), logging 2,400 presented frames. The Flash player was not entered in this run.
adriadam10 commented 2026-10-13 14:42:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:42:57Z.


Rebased onto current main (conflicts with #4140's --windows-fixed-base in Cli.hpp, CliArgs.cpp, CliArgsTests.cpp and USAGE.md; both options are kept, and the usage string lists both). Also adjusted the USAGE.md sentence that said the Windows option "does not change Linux output".

Checked: relinker + libkernel build and 248/248 ctest (linux_fixed_base, guest_dynamic_loader_fixed_base, linux_executable_exports, cli_args, relinker_conversion, windows_fixed_base); the new tests don't build without the change. Merging once the full build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6148157157 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6148157157). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T14:42:57Z. --- Rebased onto current `main` (conflicts with #4140's `--windows-fixed-base` in `Cli.hpp`, `CliArgs.cpp`, `CliArgsTests.cpp` and `USAGE.md`; both options are kept, and the usage string lists both). Also adjusted the `USAGE.md` sentence that said the Windows option "does not change Linux output". Checked: relinker + libkernel build and 248/248 ctest (`linux_fixed_base`, `guest_dynamic_loader_fixed_base`, `linux_executable_exports`, `cli_args`, `relinker_conversion`, `windows_fixed_base`); the new tests don't build without the change. Merging once the full build is green.
Recapi commented 2026-10-13 15:40:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-13T15:40:57Z.


Thanks @adriadam10 for the rebase. Verified 66b3c810c on Linux (GCC 15, Release, RTX 2080 SUPER): full build, full CTest 1,059/1,059. Ruffle (PPSA68091) relinked with --registry --linux-fixed-base 0x400000 runs its library UI for 30 s until timeout, 2,400 presented frames.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6149320752 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6149320752). Originally posted by [Recapi](https://github.com/Recapi) on 2026-10-13T15:40:57Z. --- Thanks @adriadam10 for the rebase. Verified `66b3c810c` on Linux (GCC 15, Release, RTX 2080 SUPER): full build, full CTest 1,059/1,059. Ruffle (PPSA68091) relinked with `--registry --linux-fixed-base 0x400000` runs its library UI for 30 s until timeout, 2,400 presented frames.
Recapi commented 2026-10-13 16:13:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-13T16:13:55Z.


Rebased onto main after #4547 (--trace-imports); new head c25a5783e. The conflicts were additive in Cli.hpp, CliArgs.cpp (usage string and option checks) and the USAGE.md table; all options are kept. Linux (GCC 15, Release): full build, full CTest 1,071/1,071, conventions and test-registration checks pass. --windows --trace-imports --windows-fixed-base 0x400000 still converts. Ruffle (PPSA68091), relinked with --registry --linux-fixed-base 0x400000, runs its library UI for 30 s until timeout, 2,400 presented frames.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6149957007 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6149957007). Originally posted by [Recapi](https://github.com/Recapi) on 2026-10-13T16:13:55Z. --- Rebased onto `main` after #4547 (`--trace-imports`); new head `c25a5783e`. The conflicts were additive in `Cli.hpp`, `CliArgs.cpp` (usage string and option checks) and the `USAGE.md` table; all options are kept. Linux (GCC 15, Release): full build, full CTest 1,071/1,071, conventions and test-registration checks pass. `--windows --trace-imports --windows-fixed-base 0x400000` still converts. Ruffle (PPSA68091), relinked with `--registry --linux-fixed-base 0x400000`, runs its library UI for 30 s until timeout, 2,400 presented frames.
babyhuey commented 2026-10-13 18:37:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-13T18:37:38Z.


XPSemu (PPSA97358), the third title in #4013, on Linux (headless): on main 18c438b1 with #5061 merged, every import resolves and it segfaults on its GOT read. Relinked with --linux-fixed-base 0x400000 from this PR (c25a5783, clean merge), it runs past that to getrlimit(RLIMIT_NOFILE) (#5187), and with that too, into xemu's start-up and its GPU probe (details in #5061).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152550001 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6152550001). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-13T18:37:38Z. --- XPSemu (PPSA97358), the third title in #4013, on Linux (headless): on `main` 18c438b1 with #5061 merged, every import resolves and it segfaults on its GOT read. Relinked with `--linux-fixed-base 0x400000` from this PR (c25a5783, clean merge), it runs past that to `getrlimit(RLIMIT_NOFILE)` (#5187), and with that too, into xemu's start-up and its GPU probe (details in #5061).
Recapi commented 2026-10-13 18:50:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-13T18:50:44Z.


Thanks @babyhuey. That makes XPSemu the second #4013 title past the GOT read on Linux, after Ruffle, and it shows the option works together with #5187.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152784507 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6152784507). Originally posted by [Recapi](https://github.com/Recapi) on 2026-10-13T18:50:44Z. --- Thanks @babyhuey. That makes XPSemu the second #4013 title past the GOT read on Linux, after Ruffle, and it shows the option works together with #5187.
adriadam10 commented 2026-10-14 10:50:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T10:50:07Z.


Rebased onto current main (one conflict in docs/user/USAGE.md: both options kept, the Windows paragraph now says it does not change macOS output) and added one commit: dropped R_X86_64_DTPMOD64, R_X86_64_DTPOFF64, R_X86_64_TPOFF64 and STT_TLS from ElfConstants.hpp, which main already defines and broke the build.

Checked: relinker + libkernel build and 263/263 ctest (linux_fixed_base, guest_dynamic_loader_fixed_base, linux_executable_exports, cli_args, conversion); the new tests don't build or pass without the change. Confirmed on XPSemu (PPSA97358) by @babyhuey and PPSA15304 by @ee6aba54; merging once the full build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166663729 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6166663729). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T10:50:07Z. --- Rebased onto current `main` (one conflict in `docs/user/USAGE.md`: both options kept, the Windows paragraph now says it does not change macOS output) and added one commit: dropped `R_X86_64_DTPMOD64`, `R_X86_64_DTPOFF64`, `R_X86_64_TPOFF64` and `STT_TLS` from `ElfConstants.hpp`, which `main` already defines and broke the build. Checked: relinker + libkernel build and 263/263 ctest (`linux_fixed_base`, `guest_dynamic_loader_fixed_base`, `linux_executable_exports`, `cli_args`, `conversion`); the new tests don't build or pass without the change. Confirmed on XPSemu (PPSA97358) by @babyhuey and PPSA15304 by @ee6aba54; merging once the full build is green.
github-actions[bot] commented 2026-10-14 10:53:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T10:53:59Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#4972 core/libs/prx/libkernel/CMakeLists.txt L208
#5640 core/relinker/cli/src/CliArgs.cpp L13
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166727762 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4593#issuecomment-6166727762). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T10:53:59Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #4972 | `core/libs/prx/libkernel/CMakeLists.txt` [L208](https://github.com/boykopovar/AnyPS5/blob/344afad05b6b92e57ae7b18e86fb6b42a438cd54/core/libs/prx/libkernel/CMakeLists.txt#L208) | | | | #5640 | `core/relinker/cli/src/CliArgs.cpp` [L13](https://github.com/boykopovar/AnyPS5/blob/344afad05b6b92e57ae7b18e86fb6b42a438cd54/core/relinker/cli/src/CliArgs.cpp#L13) | | |
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!4593
No description provided.