RSO (File Format): Difference between revisions
Jump to navigation
Jump to search
m
→Relocation Table
>Aruki (Created page with "The '''RSO format''' is the file format for shared objects for Wii games. This is essentially the Wii's equivalent of a DLL file, allowing for code modules to be dynamically l...") |
>Aruki |
||
Line 199: | Line 199: | ||
=== Relocation Table === | === Relocation Table === | ||
Since modules have space allocated at runtime and | Since modules have space allocated at runtime and therefore do not have a fixed memory address, the relocations table is needed to ensure all references to symbols within the RSO have the correct address. When the module is linked in, the game uses the relocation table to iterate over all instructions and data values referring to RSO symbols, and patch them to point to the correct address. | ||
There are two relocation tables in the file; one for internal relocations (relocations for addresses in this RSO pointing to symbols also in this RSO), and one for external relocations (relocations for addresses in this RSO pointing to symbols in the main [[DOL (File Format)|DOL executable]]). These tables are pointed to by the ''Internal Relocation Table Offset'' and ''External Relocation Table Offset'' values in the header. You can calculate the number of relocation entries by dividing the size of the table by 0xC (the size of one relocation entry). | There are two relocation tables in the file; one for internal relocations (relocations for addresses in this RSO pointing to symbols also in this RSO), and one for external relocations (relocations for addresses in this RSO pointing to symbols in the main [[DOL (File Format)|DOL executable]]). These tables are pointed to by the ''Internal Relocation Table Offset'' and ''External Relocation Table Offset'' values in the header. You can calculate the number of relocation entries by dividing the size of the table by 0xC (the size of one relocation entry). |