
Hi Heiko,
On Thu, Feb 24, 2011 at 3:33 PM, Heiko Schocher hs@denx.de wrote:
Albert ARIBAUD wrote: The bin length is calculated in arch/arm/lib/board.c, but it seems to me not correct ... :-(
in board_init_f():
gd->mon_len = _bss_end_ofs;
that seems correct to me, but later in board_init_r()
monitor_flash_len = _bss_start_ofs;
which is used for example in ./drivers/mtd/cfi_flash.c for protecting the flash sectors ... so this should be fixed.
In the U-Boot image itself, knowing the image size could be achieved in ARM by using a general _end symbol that would be set after the last image output section, so _end-_start would equal the image size.
we have such a "_end" in u-boot.lds files.
I guess we need a __dynsym_end in all u-boot.lds files.
For code other than the U-Boot image itself (loaders, utilities), a 'du -b u-boot.bin | cut -f 1' should be ok, provided the image is built first, which I think is already the case.
best regards, Po-Yu Chuang