Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: jcsistemas2001 on February 18, 2013, 06:02:55 AM

Title: bFLT & IDA Disassembly
Post by: jcsistemas2001 on February 18, 2013, 06:02:55 AM
Hi All,

I want to disassembly an uClinux application (.flt file) and after assembler and execute again.

Using the bFLT loader available (with IDA Pro) and following sample code (main.c):

int main(int argc, char **argv)
{
   return 0;
}

After pass this code by the toolchain [i) gcc -S main.c, ii) as main.o, iii) ld.exe -elf2flt crti.o crtn.o crt1.o libc.a main.o), the program run without problems in a Coldfire board.

After that, I disassemble the main.flt (obtained from the previous process) with the bFLT loader and IDA (with default options). Later, I produce the assembler code (mainR.s) and I do the following tasks: i) as -M mainR.s, ii) ld.exe -elf2flt, iii) Execute the mainR.flt. In this last task, I get an error if I try to execute the program mainR.flt:

"Unable to read code data bss, errno 22"

The header FLT is:

Magic:        bFLT
Rev:          4
Build Date:   Mon Feb 18 18:02:34 2013
Entry:        0x50
Data Start:   0x480
Data End:     0x3f
BSS End:      0x3f
Stack Size:   0x1000
Reloc Start:  0x3f
Reloc Count:  0xb
Flags:        0x1 ( Load-to-Ram )

And the original (before use the loader and IDA) is:

Magic:        bFLT
 Rev:          4
 Build Date:   Mon Feb 18 17:46:13 2013
 Entry:        0x44
 Data Start:   0x400
 Data End:     0x43c
 BSS End:      0x470
 Stack Size:   0x1000
 Reloc Start:  0x43c
 Reloc Count:  0x2f
 Flags:        0x1 ( Load-to-Ram )

I'm not sure where the problem is.

Please, if you can give any advices.

Thanks
Title: Re: bFLT & IDA Disassembly
Post by: torne on February 18, 2013, 09:47:41 AM
This forum is about the development of Rockbox, and has nothing to do with uClinux. This is not really a suitable place to ask.
Title: Re: bFLT & IDA Disassembly
Post by: jcsistemas2001 on February 19, 2013, 01:18:30 AM
Hello Torne,

I asked because I found this on their website:

http://www.rockbox.org/wiki/pub/Main/AngoraVX435/rebfltidaloader.zip

Anyway, Thanks