From: Jon Smirl Date: Thu, 26 Mar 2009 12:40:04 -0400 Subject: [U-Boot] Size of external u-boot commands In-Reply-To: <9e4733910903260810p1fa85e5fuef506fb30d1c7a33@mail.gmail.com> References: <9e4733910903260647w549a97acv7101ea9347a767bb@mail.gmail.com> <49CB88A7.7040407@ge.com> <9e4733910903260721l40edac53l96b3a1d78015ad0b@mail.gmail.com> <070EC82A-C889-446C-A66D-E2742B228C53@semihalf.com> <9e4733910903260806q59422e42j869f7e1343e62fcc@mail.gmail.com> <9e4733910903260810p1fa85e5fuef506fb30d1c7a33@mail.gmail.com> Message-ID: <9e4733910903260940h57acc92bpf64e82d49ecf5b21@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Mar 26, 2009 at 11:10 AM, Jon Smirl wrote: > On Thu, Mar 26, 2009 at 11:06 AM, Jon Smirl wrote: >> On Thu, Mar 26, 2009 at 10:43 AM, Rafal Jaworowski 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