public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [Fwd: Re:  reducing size of u-boot binary]
Date: Mon, 17 Dec 2007 08:38:44 -0500	[thread overview]
Message-ID: <47667BE4.3070700@ge.com> (raw)
In-Reply-To: <1197700077.2679.16.camel@root>

vibi wrote:
> On Fri, 2007-12-14 at 07:20 -0500, Jerry Van Baren wrote:
>> vibi wrote:
>>> hello,
>>> 	can any one please tell me how to reduce the size of u-boot.bin.
>>> 	i tried by disabling commands in the
>>> 	include/config/at91rm9200dk.h,as per the read me document
>>> 	even after this when i compile,i was unable to decrease the 
>>> 	size.
>>>
>>> 	thanks in advance.
>>> 	
>>> 	regards
>>> 	vibi sreenivasan
>> How big is your binary, why do you need to reduce its size?  I ask 
>> because most of the time this question is the result of a link gone bad 
>> where part of the linked binary lives in low memory space and part lives 
>> in high memory space.  As a result, the .bin has a huge amount of filled 
>> (unused) data between the two.
>>
>> Best regards,
>> gvb
> 
> dear jerry,
> 	thanks for your reply.i am using u-boot 1.1.5 .my binary is only 90kb &
> i still wanted to reduce the size.i thought compiling u-boot is like
> compiling linux kernel,ie source file for the disabled commands wont get
> compiled,now i understood that i was wrong.
> 
> i wanted to reduce size to less than 90kb because of constraints in
> available flash memory space.
> 
> i have done it by disabling bootp & rarp by using #define macros
> i didnt find option for that in /include/cmd_confdefs.h .
> 
> once again i thank you for your response
> 
> thanks & regards
> vibi sreenivasan

Hi Vibi,

90K is already pretty small for a u-boot image.  I don't know how small 
u-boot can get, but rule of thumb is 128K is a reasonable size for good 
functionality.
   <http://www.denx.de/wiki/view/UBoot/DesignPrinciples>

With respect to the commands, disabling commands should cut the actual 
command code out via #ifdefs, so disabling commands should result in a 
smaller image, even though all the files are still compiled.
a) There is a limit to how much can be cut out by removing commands.
      There still is a lot of support code necessary.
b) It is possible that a command that is disabled needs a support
      function, but the support function isn't disabled so not all the
      potential savings are realized.

Note that u-boot is going to a better configuration and linking 
methodology that doesn't compile unused pieces (as opposed to compiling 
code that is #ifdefed out).  I don't expect this to save any significant 
amount of memory, but it is possible that it will turn up and fix errors 
or inefficiencies with the current method.

Best regards,
gvb

      reply	other threads:[~2007-12-17 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-15  6:27 [U-Boot-Users] [Fwd: Re: reducing size of u-boot binary] vibi
2007-12-17 13:38 ` Jerry Van Baren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47667BE4.3070700@ge.com \
    --to=gerald.vanbaren@ge.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox