How to include IRX files in .ELF ?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
BiB
Posts: 36
Joined: Fri Feb 27, 2004 8:13 am
Location: France

How to include IRX files in .ELF ?

Post by BiB »

Hi all,

I see that some programs don't have .IRX files but load modules anyway.
I deduce they are included in the .ELF file.

I saw that in the Altimit project, but when reading source code, i don't know how it loads module.

Can someone tell me how does it works ?

thx
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

1) produce a .s file out of the irx file:

Code: Select all

bin2s my_module.irx my_module.s my_module

2) declare the module into your C code:

Code: Select all

extern unsigned char my_module[];
extern unsigned int size_my_module;

3) load the module into your C code:

Code: Select all

int ret;
SifExecModuleBuffer(my_module, size_my_module, 0, NULL, &ret);

4) don't forget to compile the .s file with your C code:

Code: Select all

ee-gcc -o final_binary.elf my_code.c my_module.s
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
BiB
Posts: 36
Joined: Fri Feb 27, 2004 8:13 am
Location: France

Post by BiB »

ok thanks a lot for your quick and very precise answer.

However i still have a problem.

I downloaded Altimit 0.1 (src and bin) ans when i compile sources, i don't have the same size as the original ELF (this last works)
Mine is 328 Ko (uncompressed) whereas the original is 1 Mb

What am i doing wrong
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post by blackdroid »

yours might be stripped from symbols, the distributed 0.1 elf might not, wich would make debugging easier for tombola.
Kung VU
User avatar
evilo
Posts: 230
Joined: Thu Apr 22, 2004 8:40 pm
Contact:

Post by evilo »

very very interesting information, I will certainely resuse it also for my project ;)

thanks for the tip !
Post Reply