Skip to content

Reloc addrs docs#467

Merged
ethteck merged 8 commits intoethteck:mainfrom
AngheloAlf:reloc_addrs_docs
Aug 25, 2025
Merged

Reloc addrs docs#467
ethteck merged 8 commits intoethteck:mainfrom
AngheloAlf:reloc_addrs_docs

Conversation

@AngheloAlf
Copy link
Collaborator

Add documentation for the reloc_addrs.txt format.

I also changed create_config to create a basic symbol_addrs.txt and reloc_addrs.txt from the information it is already gathering.

The generated symbol_addrs.txt file just names the entrypoint and the main symbols.
Example for the generated file:

// Visit https://github.com/ethteck/splat/wiki/Adding-Symbols for documentation about this file
entrypoint = 0x80000400; // type:func
main = 0x80000520; // type:func

The reloc_addrs.txt file contains relocs for the bss symbols referenced by the entrypoint.
It also contains a commented out entry for the stack, it is commented out because we can't infer the actual start of that symbol with just the info on the entrypoint, instead I left a comment explaining this.
Example for the generated file:

// Visit https://github.com/ethteck/splat/wiki/Advanced-Reloc for documentation about this file
// entrypoint relocs
rom:0x001000 reloc:MIPS_HI16 symbol:main_BSS_START
rom:0x001004 reloc:MIPS_LO16 symbol:main_BSS_START

rom:0x001008 reloc:MIPS_HI16 symbol:main_BSS_SIZE
rom:0x00100C reloc:MIPS_LO16 symbol:main_BSS_SIZE

// This entry corresponds to the "stack top", which is the end of the array used as the stack for the main segment.
// It is commented out because it was not possible to infer what the start of the stack symbol is, so you'll have to figure it out by yourself.
// Once you have found it you can properly name it and specify the length of this stack as the addend value here.
// The address of the end of the stack is 0x801AD9A0.
// A common size for this stack is 0x2000, so try checking for the address 0x801AB9A0. Note the stack may have a different size.
// rom:0x001030 reloc:MIPS_HI16 symbol:main_stack addend:0xXXXX
// rom:0x001038 reloc:MIPS_LO16 symbol:main_stack addend:0xXXXX

closes #465

@ethteck ethteck merged commit f8b09ec into ethteck:main Aug 25, 2025
9 checks passed
@AngheloAlf AngheloAlf deleted the reloc_addrs_docs branch August 25, 2025 16:48
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.

add reloc_addrs docs

2 participants