Symbol order validation#129
Merged
Merged
Conversation
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
Mrkol
force-pushed
the
symbol-order-validation
branch
from
July 23, 2026 21:35
8dbb486 to
5916871
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.