Skip to content

vms-0ab: -static the netbsd-vax boot images (kill ld.elf_so per-activation re-relocation) — boot-speed #2 - #762

Closed
baron-3dl wants to merge 1 commit into
mainfrom
work/vms-0ab-v2
Closed

baron-3dl wants to merge 1 commit into
mainfrom
work/vms-0ab-v2

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

Boot-speed fix #2 (the confirmed VAX-demo lever, per the PCjs peer's empirical profile). The netbsd-vax boot images were dynamically linked, so every fork()+execve() activation paid ld.elf_so re-relocating libc/libpthread/libm/libatomic from scratch — a per-activation tax native VMS's prelinked activation never pays. This statically links them, deleting ld.elf_so from every activation.

What

  • tools/cross-vax/build-*-vax.sh (boot-images/job-control/loginout/ovmx-init/provision/vmsdcl): -static link the boot images (DCL/PROVISION/LOGINOUT/JOB_CONTROL/STARTUP).
  • Weak-seam anchors (the [[static-link-weak-seam-anchor]] caveat): a -static image can drop a #pragma weak engine → the facility silently fails (this class bit Alpha login). Added loginout_rms_bind.o / dcl_rms_bind.o force-anchor TUs so the SYSUAF auth engines (sysuaf_authenticate/purdy_s_hash/ovmx_sysuaf_read_user) are linked into the auth-path images.

Proof (real SIMH, readelf + boot)

  • readelf on all 5 elf32-vax boot images: statically linked — no PT_INTERP, no DT_NEEDED. The 3 auth engines DEFINED (not UND) in PROVISION/LOGINOUT/DCL.
  • run-boot.sh sysboot-single boots clean to Username: with the -static images — no "User authorization failure" (the anti-LARP proof the weak-seam anchors held under -static), sha256 changed (real ODS-2 writes).

VAX build-recipe + anchor TUs only — VAX-substrate, does NOT ride the 3-way. The size delta is ~0 on disk (larger images fit inside the fixed FFS partition); the win is boot-speed (measured by the PCjs peer's v1→v2 A/B). Branch cherry-picks cleanly onto #758 (single-disk harness).

…tion per activation)

Boot-speed #2. The five netbsd-vax boot images (STARTUP/PROVISION/DCL/
JOB_CONTROL/LOGINOUT) were dynamic ELF32-vax activated by /usr/libexec/ld.elf_so.
The in-process IMGACT bails SS$_UNSUPPORTED on the foreign interp, so every boot
activation is fork+execve and ld.elf_so re-relocated libc/libpthread/libm/
libatomic from scratch (~4x/boot) -- a cost native VMS's prelinked activation
never pays. Link all five -static: no PT_INTERP, no DT_NEEDED.

Static-link weak-seam anchors (anti-LARP): LOGINOUT's sysuaf_lookup() and DCL's
SHOW/F$IDENTIFIER reach the SYSUAF/RIGHTSLIST engines through a #pragma weak
seam whose reader cells were ALREADY UND=0 in the dynamic baseline (a weak undef
does not pull an archive member). Force-anchor them with the existing production
anchor TUs -- src/vmslink/loginout_rms_bind.c and src/vmslink/dcl_rms_bind.c
(reused, not reinvented) -- so sysuaf_rms.o/rightslist_live.o are pulled and the
engines are DEFINED in each -static image. PROVISION already strong-calls the
engine (survives -static). Per-image readelf proofs assert engines DEFINED (not
UND) + no PT_INTERP/DT_NEEDED. The boot-images gate now asserts the static
contract instead of the dynamic one.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@baron-3dl

Copy link
Copy Markdown
Contributor Author

Closing: the -static A/B measured a +6.44% REGRESSION (+25.2M instr, all in PROVISION), and code investigation confirms it's inherently worse on netbsd-vax, not a fixable bug — the ownership walk is link-mode-invariant, so the +24.8M is pure image-load/self-relocation cost from de-sharing the ld.elf_so-relocated libc/RTL that Decision A (design-p4-netbsd-vax-boot.md §4.5.1) shares across the dynamic boot chain. Not a boot-speed lever. Branch work/vms-0ab-v2 preserved for reference (weak-seam anchor TUs) if the global-sections endgame ever revisits static. Real levers are Fix D (PROVISION skip-already-owned) + a DCL label-offset cache — tracked in vms-af26.

@baron-3dl baron-3dl closed this Aug 23, 2026
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