Skip to content

fix(relinker): rebase the grown Linux program header table - #6403

Closed
MarcZX10 wants to merge 1 commit into
boykopovar:mainfrom
MarcZX10:codex/linux-fixed-base-grown-phdr-table-6393
Closed

MarcZX10 wants to merge 1 commit into
boykopovar:mainfrom
MarcZX10:codex/linux-fixed-base-grown-phdr-table-6393

Conversation

@MarcZX10

@MarcZX10 MarcZX10 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Tested

  • Linux x86-64: relinker-only Release build completed.
  • python3 core/relinker/relinker/tests/test_linux_fixed_base.py /tmp/AnyPS5-6393-build/core/relinker/relinker passed.
  • The new regression fails against the unmodified main binary (0x401118 is unmapped).
  • python3 tools/check_conventions.py --base upstream/main and git diff --check passed.

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 or are documented; not applicable
  • No notes, investigation .md files or images added
  • New third-party code is a submodule built from source; not applicable
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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
PR 6224 core/relinker/relinker/tests/test_linux_fixed_base.py L34, L37

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6447 core/relinker/elfpatcher/src/linux/LinuxElfPatcher.cpp

@MarcZX10
MarcZX10 force-pushed the codex/linux-fixed-base-grown-phdr-table-6393 branch from 3875a07 to e8c42e3 Compare October 15, 2026 15:03
@MarcZX10

Copy link
Copy Markdown
Contributor Author

I rebased the focused #6393 fix commit onto current main and removed the old parent history from the PR branch. The current-main Release relinker build and test_linux_fixed_base.py pass; the relocated-table regression confirms the entry is mapped at the fixed base. Conventions and git diff --check also pass.

@saxopa

saxopa commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Ran this on a real x86-64 kernel (QEMU system emulation, Linux 6.6.134, Ubuntu 24.04 glibc), with the fixture from this PR's test_linux_fixed_base.py, relinker-only builds of main 82ddae7 and this branch:

output main this PR
6 slots, --linux-fixed-base SIGTRAP (expected) SIGTRAP
3 slots (table moves), --linux-fixed-base SIGSEGV SIGTRAP

So the moved-table case crashes at start on main and runs at the base with this change. The new test case only inspects the file; running grown_path next to fixed_path in the Linux execution block would cover the crash itself.

AI-assisted: yes (Claude Code).

@MarcZX10

Copy link
Copy Markdown
Contributor Author

Thanks for the QEMU execution comparison. It confirms the moved-table fixture reaches the runtime failure on main and no longer crashes with this fix. The adjacent grown_path execution check is a useful addition to make that behavior part of CI; I have not changed the PR yet because #6224 already carries the overlapping moved-table regression.

@MarcZX10

Copy link
Copy Markdown
Contributor Author

Thanks for the QEMU runtime check. It confirms the moved-table input crashes on main and reaches the fixed base with this change. Your suggested grown_path execution check would make that runtime behavior part of CI. I have not added it because #6224 and #6447 also carry the same table-offset fix; I’ll leave this PR open and avoid duplicating their test changes pending consolidation guidance.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing in favour of #6224, which has the same tableOff fix and now carries this PR's three-slot fixture (folded in 2cf75db), as you offered on the 15th.

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.

relinker: --linux-fixed-base rebases the stale program header table when the table has to grow

3 participants