WIP: Correct symbol-only relocation values #3

Draft
erikinkinen wants to merge 1 commit from feature/posix-compat into main
Owner

Summary and rationale

Correct the graph planner's x86-64 GLOB_DAT and eager JUMP_SLOT values. They now use the resolved symbol value S, regardless of the unused RELA addend. An accepted symbol at 0x40002000 with addend 16 previously produced 0x40002010; it now produces 0x40002000. Absolute relocation remains checked S + A and relative relocation remains checked B + A.

Tracking and scope

Bug: #2. Authority and quality audit: #1. Signed correction: abd5153adf994ca40753f9650a675940a228e1d3 on feature/posix-compat. This review covers the library calculation, nine independent regression controls, inline/component documentation and warning-denied CI. The manual/API companion is erix/docs#4. Downstream source candidates and both matching automatic CI runs pass. Coherent catalog adoption and native frame acceptance remain open.

Architecture, authority and failure behavior

The planner remains allocation-free, without I/O or capabilities. Caller-supplied object bytes, graph membership and writable target ranges remain the only inputs. Provider selection, checked provider-base arithmetic, weak/strong resolution, target ownership, bounds and text-relocation rejection are unchanged. No API signature, wire format, unsafe code, global lookup, object acquisition or relocation application is added. The pure calculation introduces no capability lifetime or cleanup path.

The implementation follows the primary x86-64 psABI relocation table. Signed/extreme unused addends must neither change S nor spuriously cause overflow. Genuine provider-base, S + A and B + A overflow still refuses the plan. The retained native executable and six libraries have 107 symbol-only relocations, all with zero addends; no guest failure or speedup is asserted.

Validation evidence

At the signed revision, formatting, Markdown, canonical templates and whitespace checks pass. Four default/all-feature by dev/release configurations each pass 47 unit tests, strict host/native Clippy and a warning-denied native build for x86_64-unknown-none; private rustdoc passes with warnings denied. All code files remain below 1,000 physical lines.

The same nine new controls run against the original production graph implementation: five fail and four pass. All nine pass with the correction. They cover signed/extreme addends, imported providers, missing weak/strong symbols, overflow and writable target ownership. The original two-test literal reproduction remains retained in #2.

Both matching automatic runs 30 and 31 pass at abd5153adf994ca40753f9650a675940a228e1d3: four complete logs (36,856 bytes), 47 tests per run, strict host/native builds and private rustdoc, zero warnings.

Original-source consumer candidates changing only this library selector pass four configurations each: dynlinkd 13 tests, loaderd 105 and bootloader 41, with twelve native builds, strict Clippy and private rustdoc without warnings. Their published revisions remain unchanged. Native metadata replay checks all 1,608 independently expected writes across the retained executable and six libraries. All 107 symbol-only records preserve their values for positive/negative/extreme unused addends with the fix; the original implementation fails the addend-16 control. This host calculation establishes no execution or frame acceptance.

Signed companion Docs 214b08666b8b36ad4270bcfee3b3379d8dc08a79 passes 45 tests, a full 2,383-page manual, all-page bounds and four changed-page visual reviews, zero final warnings. Its matching CI 913/914 passes. Only this library's API snapshot is regenerated, from the exact signed revision. No new guest capability or runtime feature is introduced by this arithmetic correction; whole-image and existing VM regressions remain required adoption checks.

Review checklist

  • Original specification-derived implementation and independent regression controls.
  • Signed canonical commit and full-commit dependency policy.
  • Rustdoc, strict local checks and cohesive code files below 1,000 lines.
  • Relevant README, ARCHITECTURE and ROADMAP updated; canonical governance unchanged.
  • Complete downstream candidate and manual/API evidence.
  • Classify both matching automatic CI runs and preserve remaining adoption gates.
  • Complete coherent consumer/catalog adoption and applicable existing VM evidence.

Keep this review unfinished until its dependent acceptance checks are accounted for. No merge or release is requested.

## Summary and rationale Correct the graph planner's x86-64 GLOB_DAT and eager JUMP_SLOT values. They now use the resolved symbol value S, regardless of the unused RELA addend. An accepted symbol at `0x40002000` with addend 16 previously produced `0x40002010`; it now produces `0x40002000`. Absolute relocation remains checked S + A and relative relocation remains checked B + A. ## Tracking and scope Bug: #2. Authority and quality audit: #1. Signed correction: `abd5153adf994ca40753f9650a675940a228e1d3` on `feature/posix-compat`. This review covers the library calculation, nine independent regression controls, inline/component documentation and warning-denied CI. The manual/API companion is https://git.erikinkinen.fi/erix/docs/pulls/4. Downstream source candidates and both matching automatic CI runs pass. Coherent catalog adoption and native frame acceptance remain open. ## Architecture, authority and failure behavior The planner remains allocation-free, without I/O or capabilities. Caller-supplied object bytes, graph membership and writable target ranges remain the only inputs. Provider selection, checked provider-base arithmetic, weak/strong resolution, target ownership, bounds and text-relocation rejection are unchanged. No API signature, wire format, unsafe code, global lookup, object acquisition or relocation application is added. The pure calculation introduces no capability lifetime or cleanup path. The implementation follows the primary [x86-64 psABI relocation table](https://gitlab.com/x86-psABIs/x86-64-ABI/-/raw/master/x86-64-ABI/object-files.tex). Signed/extreme unused addends must neither change S nor spuriously cause overflow. Genuine provider-base, S + A and B + A overflow still refuses the plan. The retained native executable and six libraries have 107 symbol-only relocations, all with zero addends; no guest failure or speedup is asserted. ## Validation evidence At the signed revision, formatting, Markdown, canonical templates and whitespace checks pass. Four default/all-feature by dev/release configurations each pass 47 unit tests, strict host/native Clippy and a warning-denied native build for `x86_64-unknown-none`; private rustdoc passes with warnings denied. All code files remain below 1,000 physical lines. The same nine new controls run against the original production graph implementation: five fail and four pass. All nine pass with the correction. They cover signed/extreme addends, imported providers, missing weak/strong symbols, overflow and writable target ownership. The original two-test literal reproduction remains retained in #2. Both matching automatic runs [30](https://git.erikinkinen.fi/erix/lib-dynlink/actions/runs/30) and [31](https://git.erikinkinen.fi/erix/lib-dynlink/actions/runs/31) pass at `abd5153adf994ca40753f9650a675940a228e1d3`: four complete logs (36,856 bytes), 47 tests per run, strict host/native builds and private rustdoc, zero warnings. Original-source consumer candidates changing only this library selector pass four configurations each: dynlinkd 13 tests, loaderd 105 and bootloader 41, with twelve native builds, strict Clippy and private rustdoc without warnings. Their published revisions remain unchanged. Native metadata replay checks all 1,608 independently expected writes across the retained executable and six libraries. All 107 symbol-only records preserve their values for positive/negative/extreme unused addends with the fix; the original implementation fails the addend-16 control. This host calculation establishes no execution or frame acceptance. Signed companion Docs `214b08666b8b36ad4270bcfee3b3379d8dc08a79` passes 45 tests, a full 2,383-page manual, all-page bounds and four changed-page visual reviews, zero final warnings. Its matching CI 913/914 passes. Only this library's API snapshot is regenerated, from the exact signed revision. No new guest capability or runtime feature is introduced by this arithmetic correction; whole-image and existing VM regressions remain required adoption checks. ## Review checklist - [x] Original specification-derived implementation and independent regression controls. - [x] Signed canonical commit and full-commit dependency policy. - [x] Rustdoc, strict local checks and cohesive code files below 1,000 lines. - [x] Relevant README, ARCHITECTURE and ROADMAP updated; canonical governance unchanged. - [x] Complete downstream candidate and manual/API evidence. - [x] Classify both matching automatic CI runs and preserve remaining adoption gates. - [ ] Complete coherent consumer/catalog adoption and applicable existing VM evidence. Keep this review unfinished until its dependent acceptance checks are accounted for. No merge or release is requested.
fix: Preserve symbol-only relocation values
All checks were successful
CI / markdown (push) Successful in 8s
CI / test (push) Successful in 32s
CI / markdown (pull_request) Successful in 14s
CI / test (pull_request) Successful in 38s
abd5153adf
Compute GLOB_DAT and eager JUMP_SLOT as the resolved symbol value, ignoring
the unused RELA addend. Keep checked S+A and B+A for absolute and relative
records, with unchanged provider selection and writable target validation.

Add nine independent expression and ownership controls; five distinguish
the original defect while four retain existing arithmetic and range rules.
Pass four strict 47-test configurations and native builds. Deny warnings
in CI and document the exact psABI expressions.
All checks were successful
CI / markdown (push) Successful in 8s
CI / test (push) Successful in 32s
CI / markdown (pull_request) Successful in 14s
CI / test (pull_request) Successful in 38s
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/posix-compat:feature/posix-compat
git switch feature/posix-compat

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feature/posix-compat
git switch feature/posix-compat
git rebase main
git switch main
git merge --ff-only feature/posix-compat
git switch feature/posix-compat
git rebase main
git switch main
git merge --no-ff feature/posix-compat
git switch main
git merge --squash feature/posix-compat
git switch main
git merge --ff-only feature/posix-compat
git switch main
git merge feature/posix-compat
git push origin main
Sign in to join this conversation.
No description provided.