Skip to content

Rewrite symbol management system - #543

Merged
ethteck merged 49 commits into
ethteck:mainfrom
AngheloAlf:symbol_segments
Jul 27, 2026
Merged

ethteck merged 49 commits into
ethteck:mainfrom
AngheloAlf:symbol_segments

Conversation

@AngheloAlf

Copy link
Copy Markdown
Collaborator

Completely rewrite how splat internally tracks symbols.

This rewrite was made to try to fix all the nasty issues regarding overlapping overlays, like using a symbol from a different overlay producing duplicated names, not using the corresponding name format, splat sometimes ignoring some user-declared symbols, etc.

This PR should unblock people from working with overlays.

This PR also makes splat a lot more strict about user-declared symbols.
splat now will reject symbols that are ambiguously declared, for example.

  • Overlay symbol with segment: and rom: attributes missing. You need to tell splat to which segment they are associated.
    • Symbols with no segment: and rom: are assumed to be part of any of the global segments. If no global segment cover this symbol then it will be rejected.
  • Associating a symbol to a segment that doesn't cover its address.
  • Declaring a wrong Rom address for a symbol given its Vram address.

If you were declaring a symbol as part of a segment it didn't belong to as a visibility hack, then you should move to the new "prioritised_segment" system. It allows to tell which segments a given segment can see, allowing to control the symbol visibility per segment.

For symbols that are not part of any segment, you should declare them with absolute:True.
An example of symbols like this are the libultra pif symbols (osTvType, etc).

Some arbitrary fixes:

image image image image

@ethteck ethteck left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of my things are just language changes. I'm happy to see splat have a better system for symbol resolution and management . thanks for all your work as always :)

Happy to go in and make all these language changes myself if you don't mind.

Comment thread docs/Adding-Symbols.md Outdated
Comment thread docs/Segments.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
* It is pretty likely for many symbols that have autogenerated names to change their naming a bit.
* In the past splat failed to properly set some attributes required for autogenerated symbol naming, so splat symbolized them "wrong". For example it only used the vram address (like `D_{VRAM}`) when it should have been using both the vram and rom addresses (`D_{VRAM}_{ROM}`) for naming overlay symbols.
* Now those attributes are correctly set, meaning those symbols are correctly named now.
* This is breaking if you were referencing those wrongly named symbols in C code, because you'll get linker errors for not finding the old named symbols.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like all these bullets should be moved to a caution section of the changelog and shouldn't be separate - they're all about the same idea. It can just be a new caution paragraph or something

Comment thread CHANGELOG.md
* Now those attributes are correctly set, meaning those symbols are correctly named now.
* This is breaking if you were referencing those wrongly named symbols in C code, because you'll get linker errors for not finding the old named symbols.
* Versions between 0.41.0 and 0.50.0 have been skipped as a way to note this can be a pretty big breaking change.
* Rewrite symbol management system.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're switching verb tenses here - "stuff has been done" vs "do stuff". Personally, for splat, I'd prefer the past tense for the changelog. I can do an edit pass on this if you don't mind.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would appreciate a lot if you did that! Feel free to go ahead, I kinda suck writing up stuff 😅

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
@AngheloAlf

Copy link
Copy Markdown
Collaborator Author

btw, I'm not a great fan about the name SegmentMetadataGroup.
It is a grouping for all the segments, and it is used to find symbols and segments, but the name feel lazy. Do you have any better suggestion?

@ethteck

ethteck commented Jul 13, 2026

Copy link
Copy Markdown
Owner

btw, I'm not a great fan about the name SegmentMetadataGroup. It is a grouping for all the segments, and it is used to find symbols and segments, but the name feel lazy. Do you have any better suggestion?

SegmentManager?

@AngheloAlf

Copy link
Copy Markdown
Collaborator Author

dun

@ethteck
ethteck merged commit 1d09139 into ethteck:main Jul 27, 2026
29 checks passed
@AngheloAlf
AngheloAlf deleted the symbol_segments branch July 27, 2026 17:47
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.

2 participants