fix(relinker): bound the jump relocation table range #1424

Merged
muhzain05 merged 1 commit from upstream-pr/1424 into main 2026-10-08 13:39:32 +00:00
muhzain05 commented 2026-10-08 04:19:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by muhzain05 on 2026-10-08T04:19:20Z.


What

DT_JMPREL / DT_PLTRELSZ were not range-checked against the input file.

With the Sony DT_OS_JMPREL variant the offset is returned raw, without TranslateVirtualAddress and without a bounds check, and DT_OS_PLTRELSZ is read the same way. The declared range was then used without being compared to the image:

  • When DT_PLTRELSZ is zero, the extractRela and extractRelative loop conditions (relaSize >= relaEntSize) never execute, so no per-entry check ever sees the offset. On main an ELF with DT_OS_JMPREL = 0xFFFFFFFFFFFFFFFF and DT_OS_PLTRELSZ = 0 exits 0 and writes an output executable.
  • For the DT_OS_ tag pair with DT_PLTRELSZ zero, conversion succeeds and the out-of-range offset is carried into the generated output: scanning the produced file shows DT_OS_JMPREL 0xffffffffffffffff with DT_OS_PLTRELSZ 0 (and 0x1001 for the past-EOF case). The SysV DT_JMPREL / DT_PLTRELSZ pair is not emitted for these inputs. The offset also reaches SysVDynamicSectionBuilder::BuildDynamicSection as originalJmprelOffset, and UnusedNidFilter::CompactPlt with --unused-filter=2.

This is an output-correctness problem, not a diagnostic preference: the relinker writes a jump-relocation table location that lies outside the input image into the executable it produces, instead of throwing.

Validate the declared range with the same overflow-safe subtraction-style check already used for DT_STRTAB / DT_STRSZ, placed next to it and before the table is read. The string table range is already validated unconditionally, whether or not a string is read, and string_table_bounds asserts an out-of-range table is rejected; this follows that existing behaviour for the jump relocation table. The range and termination requirements for the dynamic array follow the ELF dynamic section specification. The guard is conditional on hasPltRelocations because dynJmpRelOffset and dynJmpRelSize are only read inside if (hasPltRelocations) and otherwise stay zero: an executable with no PLT relocation table declares no range to validate, and test_optional_plt covers that case.

Coverage, stated precisely. The new test has 10 cases. Three are a behaviour change, where main accepts the input and writes an executable and this change rejects it:

Case main this change
offset-max-empty-table (DT_OS_JMPREL = UINT64_MAX, size 0) exit 0, output written exit 2
offset-wrap-empty-table exit 0, output written exit 2
offset-past-eof-empty-table exit 0, output written exit 2

The malformed cases with a non-zero size (offset-max, offset-wrap, size-past-eof, size-max) already fail on main with Relocation entry out of bounds from the per-entry check added in #917. This change only makes the diagnostic name the jump relocation table and fail before the table is read. That is not new rejection behaviour and is not claimed as one.

os-valid, sysv-valid and empty-table are controls that must keep converting successfully. Both tag forms are covered because only the DT_OS_JMPREL variant bypasses TranslateVirtualAddress; the SysV DT_JMPREL path is already rejected by the address translation.

Related work. This covers the DT_JMPREL / DT_PLTRELSZ table-range validation at the dynamic-table level only. It does not touch extractRela, extractRelative or the symbol-table read:

  • #917 - merged: the overflow-safe per-entry relocation bounds check, since shared with extractRelative through relaEntryPos, so both per-entry readers are bounded on main. Not touched.
  • #1272 - symbol-table entry read bounds only. Not touched.
  • #1446 - the same table-range check for DT_RELA / DT_RELASZ. No shared identifiers and no shared tags; it guards the relocation table where this guards the jump relocation table. The two guards sit on adjacent lines, so whichever merges second needs a rebase.

The layers are distinct: #917 is per-entry relocation read safety, #1272 is symbol-table entry read safety, and this is table-level DT_JMPREL / DT_PLTRELSZ range validation.

#917 and #1272 protect reads: no relocation or symbol access may leave the input image. This protects a different invariant - an invalid declared jump-relocation table must not be accepted and propagated into the output just because its size is zero. With DT_PLTRELSZ zero, extractRela and extractRelative never enter their loop, so relaEntryPos is never reached and no read occurs to be bounded. The table-level check and the per-entry checks are therefore complementary. A similar table-level hunk was dropped from #1272 once #917 made the reads safe; #1424 remains necessary because the zero-size OS JMPREL value is still carried into the generated output even though no out-of-bounds read occurs.

Tested

Windows 11, MinGW-w64 GCC 16.2.0 (x86_64-ucrt-posix-seh, WinLibs), CMake 4.4.4, Ninja 1.13.2, Release with BUILD_TESTING=ON. No title, firmware or console execution. Linux is unverified.

  • Base b1c5f10d. The new test was run unmodified against a pristine b1c5f10d build in a separate worktree and fails: offset-max-empty-table exits 0 and writes the output file.
  • With the change, ctest -R jmprel_table_bounds passes and all 10 cases hold.
  • Relinker suite: 34 of 34 pass with the change, and 33 of 33 on pristine main, so there are no pre-existing failures to separate.
  • git diff --check is clean, and python3 tools/check_conventions.py --base origin/main reports no findings.
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build --parallel
ctest --test-dir build -R jmprel_table_bounds --output-on-failure
ctest --test-dir build --output-on-failure --timeout 120

test_jmprel_table_bounds.py exercises the Windows output path (--windows). This synthetic fixture does not reach the Linux or --to-intel paths: both stop earlier with Not enough program header slots: need 5, available 3, so no Linux behaviour is claimed from it.

I configured the core/relinker subproject on its own rather than the full tree, so the core/libs suites were not run; they are unrelated to this change. rela_bounds and to_intel_linux_stubs are registered only under if(UNIX AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64") and so do not run on 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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4781712900 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1424). Originally posted by [muhzain05](https://github.com/muhzain05) on 2026-10-08T04:19:20Z. --- ### What `DT_JMPREL` / `DT_PLTRELSZ` were not range-checked against the input file. With the Sony `DT_OS_JMPREL` variant the offset is returned raw, without `TranslateVirtualAddress` and without a bounds check, and `DT_OS_PLTRELSZ` is read the same way. The declared range was then used without being compared to the image: - When `DT_PLTRELSZ` is zero, the `extractRela` and `extractRelative` loop conditions (`relaSize >= relaEntSize`) never execute, so no per-entry check ever sees the offset. On `main` an ELF with `DT_OS_JMPREL = 0xFFFFFFFFFFFFFFFF` and `DT_OS_PLTRELSZ = 0` exits 0 and writes an output executable. - For the `DT_OS_` tag pair with `DT_PLTRELSZ` zero, conversion succeeds and the out-of-range offset is carried into the generated output: scanning the produced file shows `DT_OS_JMPREL 0xffffffffffffffff` with `DT_OS_PLTRELSZ 0` (and `0x1001` for the past-EOF case). The SysV `DT_JMPREL` / `DT_PLTRELSZ` pair is not emitted for these inputs. The offset also reaches `SysVDynamicSectionBuilder::BuildDynamicSection` as `originalJmprelOffset`, and `UnusedNidFilter::CompactPlt` with `--unused-filter=2`. This is an output-correctness problem, not a diagnostic preference: the relinker writes a jump-relocation table location that lies outside the input image into the executable it produces, instead of throwing. Validate the declared range with the same overflow-safe subtraction-style check already used for `DT_STRTAB` / `DT_STRSZ`, placed next to it and before the table is read. The string table range is already validated unconditionally, whether or not a string is read, and `string_table_bounds` asserts an out-of-range table is rejected; this follows that existing behaviour for the jump relocation table. The range and termination requirements for the dynamic array follow the [ELF dynamic section specification](https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.dynamic.html). The guard is conditional on `hasPltRelocations` because `dynJmpRelOffset` and `dynJmpRelSize` are only read inside `if (hasPltRelocations)` and otherwise stay zero: an executable with no PLT relocation table declares no range to validate, and `test_optional_plt` covers that case. Coverage, stated precisely. The new test has 10 cases. Three are a behaviour change, where `main` accepts the input and writes an executable and this change rejects it: | Case | `main` | this change | |---|---|---| | `offset-max-empty-table` (`DT_OS_JMPREL` = `UINT64_MAX`, size 0) | exit 0, output written | exit 2 | | `offset-wrap-empty-table` | exit 0, output written | exit 2 | | `offset-past-eof-empty-table` | exit 0, output written | exit 2 | The malformed cases with a non-zero size (`offset-max`, `offset-wrap`, `size-past-eof`, `size-max`) already fail on `main` with `Relocation entry out of bounds` from the per-entry check added in #917. This change only makes the diagnostic name the jump relocation table and fail before the table is read. That is not new rejection behaviour and is not claimed as one. `os-valid`, `sysv-valid` and `empty-table` are controls that must keep converting successfully. Both tag forms are covered because only the `DT_OS_JMPREL` variant bypasses `TranslateVirtualAddress`; the SysV `DT_JMPREL` path is already rejected by the address translation. Related work. This covers the `DT_JMPREL` / `DT_PLTRELSZ` table-range validation at the dynamic-table level only. It does not touch `extractRela`, `extractRelative` or the symbol-table read: - #917 - merged: the overflow-safe per-entry relocation bounds check, since shared with `extractRelative` through `relaEntryPos`, so both per-entry readers are bounded on `main`. Not touched. - #1272 - symbol-table entry read bounds only. Not touched. - #1446 - the same table-range check for `DT_RELA` / `DT_RELASZ`. No shared identifiers and no shared tags; it guards the relocation table where this guards the jump relocation table. The two guards sit on adjacent lines, so whichever merges second needs a rebase. The layers are distinct: #917 is per-entry relocation read safety, #1272 is symbol-table entry read safety, and this is table-level `DT_JMPREL` / `DT_PLTRELSZ` range validation. #917 and #1272 protect **reads**: no relocation or symbol access may leave the input image. This protects a different invariant - an invalid **declared** jump-relocation table must not be accepted and propagated into the output just because its size is zero. With `DT_PLTRELSZ` zero, `extractRela` and `extractRelative` never enter their loop, so `relaEntryPos` is never reached and no read occurs to be bounded. The table-level check and the per-entry checks are therefore complementary. A similar table-level hunk was dropped from #1272 once #917 made the reads safe; #1424 remains necessary because the zero-size OS JMPREL value is still carried into the generated output even though no out-of-bounds read occurs. ### Tested Windows 11, MinGW-w64 GCC 16.2.0 (`x86_64-ucrt-posix-seh`, WinLibs), CMake 4.4.4, Ninja 1.13.2, Release with `BUILD_TESTING=ON`. No title, firmware or console execution. Linux is unverified. - Base `b1c5f10d`. The new test was run unmodified against a pristine `b1c5f10d` build in a separate worktree and fails: `offset-max-empty-table` exits 0 and writes the output file. - With the change, `ctest -R jmprel_table_bounds` passes and all 10 cases hold. - Relinker suite: 34 of 34 pass with the change, and 33 of 33 on pristine `main`, so there are no pre-existing failures to separate. - `git diff --check` is clean, and `python3 tools/check_conventions.py --base origin/main` reports no findings. ``` cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON cmake --build build --parallel ctest --test-dir build -R jmprel_table_bounds --output-on-failure ctest --test-dir build --output-on-failure --timeout 120 ``` `test_jmprel_table_bounds.py` exercises the Windows output path (`--windows`). This synthetic fixture does not reach the Linux or `--to-intel` paths: both stop earlier with `Not enough program header slots: need 5, available 3`, so no Linux behaviour is claimed from it. I configured the `core/relinker` subproject on its own rather than the full tree, so the `core/libs` suites were not run; they are unrelated to this change. `rela_bounds` and `to_intel_linux_stubs` are registered only under `if(UNIX AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")` and so do not run on Windows. ### 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
muhzain05 commented 2026-10-08 11:44:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by muhzain05 on 2026-10-08T11:44:27Z.


Looping in @Dextroid17, @sktharunbalaji13-cmd, and @adriadam10 since the surrounding relinker hardening has moved quite a bit.

#1424 is still intentionally scoped to the DT_JMPREL / DT_PLTRELSZ table-range check only. #917 now owns the per-entry relocation bounds, #1272 is down to the symbol-table entry read, and #1446 is the sibling DT_RELA / DT_RELASZ table-range check.

I rebased this onto current main and re-ran the regression: the three zero-size malformed JMPREL cases are still accepted on pristine main, so this gap remains distinct. The PR is mergeable again and the diff is still just the same 3 files / +103 lines.
Mentioning you all mainly so the merge order stays coordinated and nobody accidentally folds or duplicates the JMPREL side while the adjacent PRs move.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6059129536 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1424#issuecomment-6059129536). Originally posted by [muhzain05](https://github.com/muhzain05) on 2026-10-08T11:44:27Z. --- Looping in @Dextroid17, @sktharunbalaji13-cmd, and @adriadam10 since the surrounding relinker hardening has moved quite a bit. #1424 is still intentionally scoped to the DT_JMPREL / DT_PLTRELSZ table-range check only. #917 now owns the per-entry relocation bounds, #1272 is down to the symbol-table entry read, and #1446 is the sibling DT_RELA / DT_RELASZ table-range check. I rebased this onto current main and re-ran the regression: the three zero-size malformed JMPREL cases are still accepted on pristine main, so this gap remains distinct. The PR is mergeable again and the diff is still just the same 3 files / +103 lines. Mentioning you all mainly so the merge order stays coordinated and nobody accidentally folds or duplicates the JMPREL side while the adjacent PRs move.
Dextroid17 commented 2026-10-08 12:27:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T12:27:34Z.


Correction to my first read, with measurements: I had this filed as covered by #917, and it is not.

Running your own script against a clean current main (1081602d): the case that fails is the empty table with an out-of-range offset (pltrelsz=0), where the conversion exits 0 and writes an output. A non-empty table with a bad offset is already rejected by #917's per-entry bound — relaEntryPos at RelinkerPipeline.cpp:190, shared by extractRela and extractRelative — because the bound lives inside the loop, which an empty table never enters.

DT_JMPREL is not emitted at all for these inputs; the garbage is in the OS pair. Scanning the produced file for each (tag, value) pair:

jmprel-empty-past-eof  DT_OS_JMPREL 0x2000               DT_OS_PLTRELSZ 0   DT_PLTRELSZ 0
jmprel-empty-max       DT_OS_JMPREL 0xffffffffffffffff   DT_OS_PLTRELSZ 0   DT_PLTRELSZ 0

So the conversion writes an offset outside the file into the output's dynamic table, with a size of 0. That is the "does exactly what it should or throws" case, not a message preference — which is why I think this is worth merging.

Worth saying in the body, because it is the difference from the change I withdrew. In #1272 I carried a table-level check as a second hunk and @oneandonlydean had me drop it — "#917 is on main and now bounds extractRelativethroughrelaEntryPos`, so that hunk is no longer needed". That was about the read, and he was right: no read can leave the file. This is about what is written. Naming that distinction separates your change from the hunk that was rejected.

Two smaller points: your script only exercises --windows (under --to-intel this fixture stops earlier with Not enough program header slots: need 5, available 3, so the Linux path is never reached), and hasPltRelocations && in the guard reads as intentional — I assume it is the "no PLT at all" case, but it may be worth one clause in the description so the next reader does not have to work it out.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6059847430 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1424#issuecomment-6059847430). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-08T12:27:34Z. --- Correction to my first read, with measurements: I had this filed as covered by #917, and it is not. Running **your own script** against a clean current `main` (`1081602d`): the case that fails is the empty table with an out-of-range offset (`pltrelsz=0`), where the conversion exits 0 and writes an output. A non-empty table with a bad offset is already rejected by #917's per-entry bound — `relaEntryPos` at `RelinkerPipeline.cpp:190`, shared by `extractRela` and `extractRelative` — because the bound lives inside the loop, which an empty table never enters. `DT_JMPREL` is not emitted at all for these inputs; the garbage is in the OS pair. Scanning the produced file for each `(tag, value)` pair: ``` jmprel-empty-past-eof DT_OS_JMPREL 0x2000 DT_OS_PLTRELSZ 0 DT_PLTRELSZ 0 jmprel-empty-max DT_OS_JMPREL 0xffffffffffffffff DT_OS_PLTRELSZ 0 DT_PLTRELSZ 0 ``` So the conversion writes an offset outside the file into the output's dynamic table, with a size of 0. That is the "does exactly what it should or throws" case, not a message preference — which is why I think this is worth merging. **Worth saying in the body, because it is the difference from the change I withdrew.** In #1272 I carried a table-level check as a second hunk and @oneandonlydean had me drop it — "`#917 is on main and now bounds `extractRelative` through `relaEntryPos`, so that hunk is no longer needed". That was about the **read**, and he was right: no read can leave the file. This is about what is **written**. Naming that distinction separates your change from the hunk that was rejected. Two smaller points: your script only exercises `--windows` (under `--to-intel` this fixture stops earlier with `Not enough program header slots: need 5, available 3`, so the Linux path is never reached), and `hasPltRelocations &&` in the guard reads as intentional — I assume it is the "no PLT at all" case, but it may be worth one clause in the description so the next reader does not have to work it out. Written with AI assistance.
muhzain05 commented 2026-10-08 12:33:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by muhzain05 on 2026-10-08T12:33:00Z.


Correction to my first read, with measurements: I had this filed as covered by #917, and it is not.

Running your own script against a clean current main (1081602d): the case that fails is the empty table with an out-of-range offset (pltrelsz=0), where the conversion exits 0 and writes an output. A non-empty table with a bad offset is already rejected by #917's per-entry bound — relaEntryPos at RelinkerPipeline.cpp:190, shared by extractRela and extractRelative — because the bound lives inside the loop, which an empty table never enters.

DT_JMPREL is not emitted at all for these inputs; the garbage is in the OS pair. Scanning the produced file for each (tag, value) pair:

jmprel-empty-past-eof  DT_OS_JMPREL 0x2000               DT_OS_PLTRELSZ 0   DT_PLTRELSZ 0
jmprel-empty-max       DT_OS_JMPREL 0xffffffffffffffff   DT_OS_PLTRELSZ 0   DT_PLTRELSZ 0

So the conversion writes an offset outside the file into the output's dynamic table, with a size of 0. That is the "does exactly what it should or throws" case, not a message preference — which is why I think this is worth merging.

Worth saying in the body, because it is the difference from the change I withdrew. In #1272 I carried a table-level check as a second hunk and @oneandonlydean had me drop it — "#917 is on main and now bounds extractRelativethroughrelaEntryPos`, so that hunk is no longer needed". That was about the read, and he was right: no read can leave the file. This is about what is written. Naming that distinction separates your change from the hunk that was rejected.

Two smaller points: your script only exercises --windows (under --to-intel this fixture stops earlier with Not enough program header slots: need 5, available 3, so the Linux path is never reached), and hasPltRelocations && in the guard reads as intentional — I assume it is the "no PLT at all" case, but it may be worth one clause in the description so the next reader does not have to work it out.

Written with AI assistance.

Thanks, this distinction is really helpful. The read-vs-written-output framing makes the scope much clearer, especially given the table-level hunk that was dropped from #1272. I’ll update the body to call out that the zero-size OS-tag case propagates the out-of-range JMPREL offset into the output dynamic table, and I’ll clarify the Windows-only fixture coverage plus the hasPltRelocations guard.

written with AI

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6059946273 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1424#issuecomment-6059946273). Originally posted by [muhzain05](https://github.com/muhzain05) on 2026-10-08T12:33:00Z. --- > Correction to my first read, with measurements: I had this filed as covered by #917, and it is not. > > Running **your own script** against a clean current `main` (`1081602d`): the case that fails is the empty table with an out-of-range offset (`pltrelsz=0`), where the conversion exits 0 and writes an output. A non-empty table with a bad offset is already rejected by #917's per-entry bound — `relaEntryPos` at `RelinkerPipeline.cpp:190`, shared by `extractRela` and `extractRelative` — because the bound lives inside the loop, which an empty table never enters. > > `DT_JMPREL` is not emitted at all for these inputs; the garbage is in the OS pair. Scanning the produced file for each `(tag, value)` pair: > > ``` > jmprel-empty-past-eof DT_OS_JMPREL 0x2000 DT_OS_PLTRELSZ 0 DT_PLTRELSZ 0 > jmprel-empty-max DT_OS_JMPREL 0xffffffffffffffff DT_OS_PLTRELSZ 0 DT_PLTRELSZ 0 > ``` > > So the conversion writes an offset outside the file into the output's dynamic table, with a size of 0. That is the "does exactly what it should or throws" case, not a message preference — which is why I think this is worth merging. > > **Worth saying in the body, because it is the difference from the change I withdrew.** In #1272 I carried a table-level check as a second hunk and @oneandonlydean had me drop it — "`#917 is on main and now bounds `extractRelative`through`relaEntryPos`, so that hunk is no longer needed". That was about the **read**, and he was right: no read can leave the file. This is about what is **written**. Naming that distinction separates your change from the hunk that was rejected. > > Two smaller points: your script only exercises `--windows` (under `--to-intel` this fixture stops earlier with `Not enough program header slots: need 5, available 3`, so the Linux path is never reached), and `hasPltRelocations &&` in the guard reads as intentional — I assume it is the "no PLT at all" case, but it may be worth one clause in the description so the next reader does not have to work it out. > > Written with AI assistance. Thanks, this distinction is really helpful. The read-vs-written-output framing makes the scope much clearer, especially given the table-level hunk that was dropped from #1272. I’ll update the body to call out that the zero-size OS-tag case propagates the out-of-range JMPREL offset into the output dynamic table, and I’ll clarify the Windows-only fixture coverage plus the hasPltRelocations guard. written with AI
muhzain05 commented 2026-10-08 13:31:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by muhzain05 on 2026-10-08T13:31:25Z.


Thanks — I reproduced this independently and your read-vs-output framing is much clearer.

Confirmed that the zero-size OS-tag cases still succeed on current main and the produced dynamic table carries the invalid DT_OS_JMPREL value with DT_OS_PLTRELSZ = 0, while the non-zero cases are already caught by #917.

I’ve updated the body to make that distinction explicit, clarify that the synthetic regression only reaches the Windows output path, and explain the hasPltRelocations guard. No code change needed.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6060989572 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1424#issuecomment-6060989572). Originally posted by [muhzain05](https://github.com/muhzain05) on 2026-10-08T13:31:25Z. --- Thanks — I reproduced this independently and your read-vs-output framing is much clearer. Confirmed that the zero-size OS-tag cases still succeed on current `main` and the produced dynamic table carries the invalid `DT_OS_JMPREL` value with `DT_OS_PLTRELSZ = 0`, while the non-zero cases are already caught by #917. I’ve updated the body to make that distinction explicit, clarify that the synthetic regression only reaches the Windows output path, and explain the `hasPltRelocations` guard. No code change needed. Written with AI assistance.
adriadam10 commented 2026-10-08 13:39:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T13:39:28Z.


Checked: build + full ctest on Linux with the PR merged onto current main (458/458 pass); jmprel_table_bounds fails without the RelinkerPipeline.cpp change and passes with it. The empty-table cases (DT_PLTRELSZ = 0) are indeed not reached by the per-entry bound from #917, and Dextroid17 reproduced the same on main. Merging once CI is green; #1446 will need a rebase on the adjacent line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6061142028 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1424#issuecomment-6061142028). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T13:39:28Z. --- Checked: build + full ctest on Linux with the PR merged onto current `main` (458/458 pass); `jmprel_table_bounds` fails without the `RelinkerPipeline.cpp` change and passes with it. The empty-table cases (`DT_PLTRELSZ` = 0) are indeed not reached by the per-entry bound from #917, and Dextroid17 reproduced the same on `main`. Merging once CI is green; #1446 will need a rebase on the adjacent line.
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!1424
No description provided.