Format:IRX (PlayStation 2 IOP module)
| Magic | 7F 45 4C 46 (ELF), e_type 0xFF80 |
|---|---|
| Extensions | irx |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Relocatable driver module run by the I/O Processor of the PlayStation 2: an ELF file of type 0xFF80 (SCE IOP relocatable executable) with an .iopmod section naming the module, entry point, gp and sizes, plus import and export tables embedded in the code that loadcore patches at load time.
Overview
IRX files are the IOP drivers of Platform:PlayStation 2 (SIO2MAN, MCMAN, CDVDMAN, USBD...). The IOP is a R3000A, so the code is little-endian MIPS I; the ELF container differs from a normal executable in four ways (all from the PS2SDK sources):
e_typeis0xFF80(ELF_TYPE_SCE_IRX, a Sony-specific value).- A section of type
SHT_LOPROC | 0x80(0x70000080,.iopmod) and a program header of the same type hold the module identity. - The module is relocated by the IOP's
loadcoreusing MIPS relocations (R_MIPS_32, R_MIPS_26, R_MIPS_HI16, R_MIPS_LO16). - Imports and exports are not ELF symbols: they are tables inside
.text, found by magic words.
The .iopmod structure
| Offset | Size | Field |
|---|---|---|
| 0x00 | 4 | pointer to the module id (name pointer + version) |
| 0x04 | 4 | entry point (_start)
|
| 0x08 | 4 | gp |
| 0x0C | 4 | text size |
| 0x10 | 4 | data size |
| 0x14 | 4 | bss size |
| 0x18 | 2 | module version (major in the high byte, minor in the low byte) |
| 0x1A | n | NUL-terminated module name |
Import and export tables
- Export table: first word
0x41C00000, then a link pointer, 16-bit version, 16-bit mode, an 8-byte module name and a list of function pointers terminated by 0. The function number is the index in this list. - Import table: first word
0x41E00000, link, version, mode, an 8-byte name of the exporting module, then one stub per function:jr $ra(03 E0 00 08) followed byaddiu $zero, $zero, <fno>(24 00 <fno>as0x24000000 | ordinal). loadcore replaces the stubs with jumps to the real function.
So in a disassembly of an IRX, an import is a pair jr ra; li zero, N and N is the ordinal in the exporter's table.
Source lines (ps2sdk at 329e2bb, iop/kernel/include/irx.h): IMPORT_MAGIC 0x41E00000 at line 40, irx_import_table (magic, next, u16 version, u16 mode, char name[8], stubs) lines 42-50, irx_import_stub (u32 jump, u16 fno, u16 ori_zero) lines 52-57, stub words 0x03e00008 and 0x24000000|ord lines 69-74, EXPORT_MAGIC 0x41C00000 at line 86 and irx_export_table lines 90-97; the version word is (major<<8)+minor (IRX_VER, line 22). The ELF side: tools/ps2-irxgen/src/ps2-irxgen.c renames a section called .iopmod to type SHT_LOPROC | 0x80 (lines 298-302) and writes a program header of that type with flags 4 and alignment 4 (lines 683-695); ELF type 0xFF80 is ELF_IRX_TYPE in elftypes.h line 120. See also Format:SCE ELF extensions (PlayStation consoles).
Tools
ps2-irxgen and srxfixup in the PS2SDK tree create these from ordinary ELF objects; romimg reads them from IOPRP/ROM images.
Code & repositories
- https://github.com/ps2dev/ps2sdk @
329e2bb43287e16af16c4dde1c614e2662c24468· license: AFL-2.0 (declared by the contributor; GitHub's detector did not recognize LICENSE)
Open-source PS2 SDK (AFL-2.0): IOP kernel headers (iop/kernel/include/irx.h, iop/system/loadcore) giving the IRX import/export table layout, tools/ps2-irxgen and tools/srxfixup for the IRX ELF type 0xFF80 and .iopmod section, tools/romimg for ROM images.
Tested on: source read, not run: Read at commit 329e2bb: irx.h, udnl ELF.h, ps2-irxgen elftypes.h; not built · checked 2026-10-18; last activity 2026-10-13