A file with .rel extension can be used for several kind of purposes. Therefore, in terms of game classification it is known as a relocatable module file used by some Nintendo Wii games, such as Brawl, Super Smash Bros and Mario Kart Wii. It comprises the gameplay data, including character models and stages. REL files perform similarly to the .DLL files used by the Microsoft Windows.
REL file format
In a REL file format, the file is divided into several sections, grouped by like access, e.g. read only data in one section, all executable code is placed in another, etc. The file starts with a header section, followed by the:
Table containing section info.
The section data.
The file starts with a header of up to 0x4C bytes:
Arbitrary identification number. Must be unique amongst all RELs used by a game. Must not be 0.
Pointer to next module, filled at runtime.
Pointer to previous module, filled at runtime.
Number of sections in the file.
Offset to the start of the section table.
Offset to ASCII string containing name of module. May be NULL. Relative to start of REL file.
Size of the module name in bytes.
Version number of the REL file format.
Size of the ‘.bss’ section.
Offset to the relocation table.
Offset to imp table.
Size of imp table in bytes.
Index into section table which prolog is relative to. Skip if this field is 0.
Index into section table which epilog is relative to. Skip if this field is 0.
Index into section table which unresolved is relative to. Skip if this field is 0.
Index into section table which bss is relative to. Filled at runtime!
Offset into specified section of the _prolog function.
Offset into specified section of the _epilog function.
Offset into specified section of the _unresolved function.
Version ≥ 2 only. Alignment constraint on all sections, expressed as power of 2.
Version ≥ 2 only. Alignment constraint on all ‘.bss’ section, expressed as power of 2.
Version ≥ 3 only. If REL is linked with OSLinkFixed (instead of OSLink), the space after this address can be used for other purposes (like BSS).
Section Info Table
The section info table contains of numSections entries each 0x8 bytes long:
Offset from the beginning of the REL to the section. If this is zero, the section is an uninitialized section (i.e. .bss).
Executable flag; if this is 1 the section is executable.
Length in bytes of the section. If this is zero, this entry is skipped.
The relocation data is one or more lists of 0x8 byte structures. The end of each list is marked by the special type code 203:
Offset in bytes from the previous relocation to this one. If this is the first relocation in the section, this is relative to the section start.
The relocation type. Described below.
The section of the symbol to relocate against. For the special relocation type 202, this is instead the number of the section in this file which the following relocation entries apply to.
Offset in bytes of the symbol to relocate against, relative to the start of its section. This is an absolute address instead for relocations against main.dol.