This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Porting to Atmel AT91 - stub image is *very* big


> gdb-stub and got a gdb-module.img- and a gdb-module.bin-file. BUT they
> are _very_ big:
> 
> -rwxr-xr-x   1 andreas  users    16788008 Nov  9 16:41 gdb_module.bin
> -rwxr-xr-x   1 andreas  users      240613 Nov  9 16:41 gdb_module.img

gdb_module.img will be an elf image, so generaly is big. It has all
the symbol table etc. Do

arm-elf-size gdb_module.img 

and you can find out the real size.

gdb_module.bin should not be that size. A little bit of maths...
 
1678800 = 0x1002a28. 
0x1400000 - 0x0400000 = 0x1000000.

> MEMORY
> {
>     onchip_ram :   ORIGIN = 0x0,        LENGTH = 0x2000
>     dram :         ORIGIN = 0x00400000, LENGTH = 0x200000
>     rom :          ORIGIN = 0x01400000, LENGTH = 0x100000
>     reserved :     ORIGIN = 0x00100000, LENGTH = 0x200000
> }

My guess is that the executable code is about 0x2a28 bytes and that
arm-elf-objcopy has started its binary from 0x00400000 not 0x01400000
as you would execpt. This means there must be something in the RAM
region that should not be.

Do an 

arm-elf-objdump --headers gdb_module.img

and see what sections it has in RAM. Work out what should be in ROM
and move it to ROM.

        Andrew

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]