| View previous topic :: View next topic |
| Author |
Message |
BiB
Joined: 27 Feb 2004 Posts: 36 Location: France
|
Posted: Tue Aug 24, 2004 11:48 pm Post subject: How to include IRX files in .ELF ? |
|
|
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 |
|
| Back to top |
|
 |
pixel
Joined: 30 Jan 2004 Posts: 791
|
Posted: Wed Aug 25, 2004 12:37 am Post subject: |
|
|
1) produce a .s file out of the irx file:
| Code: | | bin2s my_module.irx my_module.s my_module |
2) declare the module into your C code:
| Code: | extern unsigned char my_module[];
extern unsigned int size_my_module; |
3) load the module into your C code:
| Code: | 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: | | 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. |
|
| Back to top |
|
 |
BiB
Joined: 27 Feb 2004 Posts: 36 Location: France
|
Posted: Wed Aug 25, 2004 1:24 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
blackdroid
Joined: 17 Jan 2004 Posts: 564 Location: Sweden
|
Posted: Wed Aug 25, 2004 1:20 pm Post subject: |
|
|
yours might be stripped from symbols, the distributed 0.1 elf might not, wich would make debugging easier for tombola. _________________ Kung VU |
|
| Back to top |
|
 |
evilo

Joined: 22 Apr 2004 Posts: 230
|
Posted: Wed Aug 25, 2004 6:36 pm Post subject: |
|
|
very very interesting information, I will certainely resuse it also for my project ;)
thanks for the tip ! |
|
| Back to top |
|
 |
|