BREWelf2mod | developer.brewmp.com BREWelf2mod | developer.brewmp.com

Developer

BREWelf2mod

I compiled a little game with the Realview developer suite evaluation CD...

My .elf is 704k and when I convert it to .mod with BREWelf2mod, my .mod file is 6 Meg!!! Is that normal???

Germ

Germ wrote:I compiled a little game with the Realview developer suite evaluation CD...
My .elf is 704k and when I convert it to .mod with BREWelf2mod, my .mod file is 6 Meg!!! Is that normal???
GermOk, that "BREWelf2mod.exe" is piece of cr**ap!
You probably run it against "wrong" .elf file which may have been "corrupted" in the respect to BREWelf2mod. Basically if something is different (for example, I tried running it against ARM's native .ELF file - don't) or "wrong" with the ELF file, it would crunch through your hard drive... and you won't even be able to kill it through task manager's process list (if you even get chance to launch task manager). Eventually resulted MOD file has size measured in megabytes. It's not because of arm-elf-objdump.exe -r your.elf > __tempxxx.txt (that one is ok, it's GNU, not Qualcomm).
Try remake your .o files and .elf file. Make sure you used "recommended" switches, othewise - pfff...
It's time to open source on that one, Qualcomm! Thanks.

Germ wrote:I compiled a little game with the Realview developer suite evaluation CD...
My .elf is 704k and when I convert it to .mod with BREWelf2mod, my .mod file is 6 Meg!!! Is that normal???
GermOk, that "BREWelf2mod.exe" is piece of cr**ap!
You probably run it against "wrong" .elf file which may have been "corrupted" in the respect to BREWelf2mod. Basically if something is different (for example, I tried running it against ARM's native .ELF file - don't) or "wrong" with the ELF file, it would crunch through your hard drive... and you won't even be able to kill it through task manager's process list (if you even get chance to launch task manager). Eventually resulted MOD file has size measured in megabytes. It's not because of arm-elf-objdump.exe -r your.elf > __tempxxx.txt (that one is ok, it's GNU, not Qualcomm).
Try remake your .o files and .elf file. Make sure you used "recommended" switches, othewise - pfff...
It's time to open source on that one, Qualcomm! Thanks.

ThePhoneWiz wrote:Try remake your .o files and .elf file. Make sure you used "recommended" switches, othewise - pfff...
Could you please tell me what are recommended switches?
Germ

ThePhoneWiz wrote:Try remake your .o files and .elf file. Make sure you used "recommended" switches, othewise - pfff...
Could you please tell me what are recommended switches?
Germ

That depends on what are you building...
Try for example -O2 (many triied with that, you can also try -Os, or -O0, to prohibit any optimisation), -mcpu=arm7tdmi, -mlittle-endian, -fshort-enums, -fno-builtin, -mapcs-frame.
For linker: -Ttext 0 --emit-relocs -entry AEEMod_Load -lgcc -lc
Check the thread on this forum, at: http://brewforums.qualcomm.com/showthread.php?t=1601 - that should help you.

That depends on what are you building...
Try for example -O2 (many triied with that, you can also try -Os, or -O0, to prohibit any optimisation), -mcpu=arm7tdmi, -mlittle-endian, -fshort-enums, -fno-builtin, -mapcs-frame.
For linker: -Ttext 0 --emit-relocs -entry AEEMod_Load -lgcc -lc
Check the thread on this forum, at: http://brewforums.qualcomm.com/showthread.php?t=1601 - that should help you.

-fshort-enums, -fno-builtin, -mapcs-frame are not supported by armcc and
-Ttext 0 --emit-relocs are not supported by armlink...
Germ

-fshort-enums, -fno-builtin, -mapcs-frame are not supported by armcc and
-Ttext 0 --emit-relocs are not supported by armlink...
Germ

Germ wrote:-fshort-enums, -fno-builtin, -mapcs-frame are not supported by armcc and
-Ttext 0 --emit-relocs are not supported by armlink...
GermNo, they are not. But, why are you using BREWelf2mod.exe then? BREWelf2mod is "developed" by QC to convert .elf files created by GCC's cross compiler to MOD files for BREW phones.
Use \arm\bin\fromelf.exe your.elf -bin your.mod

Germ wrote:-fshort-enums, -fno-builtin, -mapcs-frame are not supported by armcc and
-Ttext 0 --emit-relocs are not supported by armlink...
GermNo, they are not. But, why are you using BREWelf2mod.exe then? BREWelf2mod is "developed" by QC to convert .elf files created by GCC's cross compiler to MOD files for BREW phones.
Use \arm\bin\fromelf.exe your.elf -bin your.mod

ThePhoneWiz wrote:Use \arm\bin\fromelf.exe your.elf -bin your.mod
Thanks a lot! I didn't know this program!
But the problem is my .elf is 243k and now my .mod is only 2k... Do you know what can cause that?
Germ

ThePhoneWiz wrote:Use \arm\bin\fromelf.exe your.elf -bin your.mod
Thanks a lot! I didn't know this program!
But the problem is my .elf is 243k and now my .mod is only 2k... Do you know what can cause that?
Germ

Your MOD is stripped down binary of that ELF file. If ELF file contains debug info, it can grow really big. You can also dissasemble ELF file and see the ARM native code.
I wouldn't worry about any of that, i.e. if MOD runs on the device, you're good.

Your MOD is stripped down binary of that ELF file. If ELF file contains debug info, it can grow really big. You can also dissasemble ELF file and see the ARM native code.
I wouldn't worry about any of that, i.e. if MOD runs on the device, you're good.