Skip to content

Symbol order validation#129

Merged
Mrkol merged 2 commits into
mainfrom
symbol-order-validation
Jul 23, 2026
Merged

Symbol order validation#129
Mrkol merged 2 commits into
mainfrom
symbol-order-validation

Conversation

@Mrkol

@Mrkol Mrkol commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Mrkol and others added 2 commits July 23, 2026 22:06
Adds tools/validate-symbol-order.py, which validates a TU's function
symbols against the original linker map (mario.MAP):

  * MISSING  (error)   - a map symbol (used or UNUSED) absent from our object
  * ORDER    (error)   - non-weak symbols in the wrong relative order;
                         weak-only disorder is a warning (compiler-controlled)
  * BINDING  (error)   - a placed symbol whose weak/local/global linkage
                         disagrees with the map's symbol-closure section
  * SIZE     (warning) - an UNUSED symbol whose size differs from the map

Object symbols come from `nm -S --numeric-sort` (true emission order);
binding is validated against the closure section. UNUSED-symbol binding is
deliberately not checked: dead-stripping removes weak/local/global alike and
records no binding, so it is unknowable from the map. Exit codes: 0 pass,
1 validation failure, 2 cannot run (unresolved unit / missing object / map).

tools/check-changed-symbol-order.py maps changed .cpp paths to units via
objdiff.json and runs the validator on each, skipping untracked files.

build.yml runs it on every changed .cpp (PR vs base branch, push vs previous
commit), after the build so the objects and mario.MAP are present.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CM2qHf528zJrhyALq1CLos
Fixes surfaced by the new symbol-order check, so each of these TUs now
matches the linker map (function set, non-weak order, and used-symbol
linkage; UNUSED sizes left as-is):

  * spline, Resolution, StageUtil, ProcessMeter - added missing UNUSED
    functions that were declared but never defined
  * RumbleType, MSoundDebug, MSoundScene, MSModBgm, MarioCap, riccohook -
    reordered function definitions to match the map's emission order
  * GDUtil - marked TGDLStaticOverFlow static (was global, should be local)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CM2qHf528zJrhyALq1CLos
@decomp-dev

decomp-dev Bot commented Jul 23, 2026

Copy link
Copy Markdown

Report for GMSJ01 (a4e0950 - 5916871)

No changes

@Mrkol
Mrkol force-pushed the symbol-order-validation branch from 8dbb486 to 5916871 Compare July 23, 2026 21:35
@Mrkol
Mrkol merged commit 32a9cad into main Jul 23, 2026
7 checks passed
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