[U-Boot] Size of external u-boot commands

Jon Smirl jonsmirl at gmail.com
Thu Mar 26 17:40:04 CET 2009


On Thu, Mar 26, 2009 at 11:10 AM, Jon Smirl <jonsmirl at gmail.com> wrote:
> On Thu, Mar 26, 2009 at 11:06 AM, Jon Smirl <jonsmirl at gmail.com> wrote:
>> On Thu, Mar 26, 2009 at 10:43 AM, Rafal Jaworowski <raj at semihalf.com> wrote:
>>>
>>> On 2009-03-26, at 15:21, Jon Smirl wrote:
>>>
>>>> Libraries appear to be the problem. A program that just returns is 100
>>>> bytes, add a puts("hello world") and it is 65KB.
>>>>
>>>> I had expected the u-boot app examples to be smart and use the copy of
>>>> those libraries in the u-boot image. For example the demo program in
>>>> api_examples uses printf (65K library) instead of building an api
>>>> calling into u-boot for printf.
>>>
>>> While I can understand your position, let me explain that the idea behind
>>> the API was to provide calls to really elementary operations and printf()
>>> wasn't considered as such (we only have print, get and test a single
>>> character as far as console ops go); things like pre-formatting should be
>>> done in the application...
>>>
>>> The demo application is just a demo, it links in the same printf-formatting
>>> code that U-Boot library uses, but specific standalone applications are
>>> supposed to implement their own formatting routines.
>>
>> I'm not sure that the size of the app is caused by libraries.
>>
>> jonsmirl at terra:/home/apps/u-boot/api_examples$ ls -l demo.bin
>> -rwxr-xr-x 1 jonsmirl jonsmirl 79060 2009-03-26 10:58 demo.bin
>>
>> now gzip the bin....
>> -rwxr-xr-x 1 jonsmirl jonsmirl  7677 2009-03-26 10:58 demo.bin.gz
>>
>> Here's the map file; I'm trying to remember how to read it.
>> There's probably 64K of a data segment being initialized with zeros.
>
> What is this doing? Can I turn it off?
>
> .gcc_except_table
>  *(.gcc_except_table .gcc_except_table.*)
>                0x0000000000043290                . = (ALIGN (0x10000)
> - ((0x10000 - .) & 0xffff))
>                0x0000000000053290                . = (0x10000
> DATA_SEGMENT_ALIGN 0x1000)

I don't know what I'm doing playing around with the linker scripts but
adding this:
  .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table))
*(.gcc_except_table.*) }

to the script for api_example/demo makes the binary 50KB smaller.
-rwxr-xr-x 1 jonsmirl jonsmirl 16964 2009-03-26 12:08 demo.bin



>
>
> --
> Jon Smirl
> jonsmirl at gmail.com
>



-- 
Jon Smirl
jonsmirl at gmail.com


More information about the U-Boot mailing list