[U-Boot-Users] How to reduce the size of u-boot image file

Wolfgang Denk wd at denx.de
Sat Jun 12 01:10:05 CEST 2004


In message <BAY2-F52p7vXee4fDGC0005ba2b at hotmail.com> you wrote:
> 
> If I don't change anything, then I got a u-boot as big as 716,334 bytes. The 

The ELF file, ok. This doesn't matter at all.

> u-boot.bin is about 500K if I don't change the TEXT_BASE in 

Not "about 500K". It's EXACTLY 512 kB,  as  TEXT_BASE  =  0xFFF80000,
which is 512 kB below the top of [32 bit] address space..

> board/walnut/config.mk. If I change the CONFIG_COMMANDS to default value, it 
> is reduced to 576,931. But how would you get it less than 256KB?

Move TEXT_BASE up. Or exclude .resetvec from your linker script  (but
make sure to have a valid reset vector installed).

> But before that I have to change a line in examples/Makefile
> $(OBJCOPY) -O binary $< $@ 2>/dev/null
> to:
> $(OBJCOPY) -O binary $<:.srec=) $@ 2>/dev/null

Why do you have to do this?

> I don't think this change will affact the size of the image. Am I right?

Yes.

But I think you really should try to understand the structure of such
an image, and that it includes a huge "gap" between the  real  u-boot
image (starting at TEXT_BASE) and the reset vector (at 0xFFFFFFFC).

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Remember, there's a big difference between kneeling down and  bending
over.                                                   - Frank Zappa




More information about the U-Boot mailing list