public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Size and format of standalone apps
Date: Tue, 07 Sep 2004 09:23:57 +0200	[thread overview]
Message-ID: <20040907072402.1461EC1430@atlas.denx.de> (raw)
In-Reply-To: Your message of "Tue, 07 Sep 2004 16:09:17 +1200." <413D346D.2030606@tait.co.nz>

Dear Robin,

in message <413D346D.2030606@tait.co.nz> you wrote:
> 
> For example, on powerpc, the hello_world binary is 90% nulls with just a 
> few words on the end.

Yes, ther eis a pretty huge gap between the .sdata2 and .data segments:

	-> objdump -h hello_world

	hello_world:     file format elf32-big

	Sections:
	Idx Name          Size      VMA       LMA       File off  Algn
	  0 .text         00000228  00040000  00040000  00010000  2**2
			  CONTENTS, ALLOC, LOAD, READONLY, CODE
	  1 .rodata       00000098  00040228  00040228  00010228  2**2
			  CONTENTS, ALLOC, LOAD, READONLY, DATA
	  2 .sdata2       00000000  000402c0  000402c0  000102c0  2**2
                                    ^^^^^^^^^^^^^^^^^^
			  CONTENTS, ALLOC, LOAD, READONLY, DATA
	  3 .data         00000000  000502c0  000502c0  000102c0  2**0
                                    ^^^^^^^^^^^^^^^^^^
			  CONTENTS, ALLOC, LOAD, DATA
	  4 .got2         00000028  000502c0  000502c0  000102c0  2**0
			  CONTENTS, ALLOC, LOAD, DATA
	  5 .sdata        00000000  000502e8  000502e8  000102e8  2**2
			  CONTENTS, ALLOC, LOAD, DATA
	  6 .sbss         00000000  000502e8  000502e8  000102e8  2**0
			  CONTENTS
	  7 .bss          00000000  000502e8  000502e8  000102e8  2**0
			  ALLOC
	  8 .comment      0000007a  00000000  00000000  000102e8  2**0
			  CONTENTS, READONLY
...

> How can I truncate this to make the code more space efficient or change 
> the link order to not have this vast embedded block of wasted space?

Use a linker script which optimizes the size of the segments.

> It appears to be associated with libgcc so perhaps there is a way of 

No, this has nothing to do with libgcc. It's more a question  of  how
you link the image.

> forcing these functions to be inlined? Is there a way of avoiding them 
> altogether or perhaps since U-Boot has already included them, maybe more 
> vectors to gain access to them?

This is not the problem.

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
Just about every computer on the market today runs Unix,  except  the
Mac (and nobody cares about it).                   - Bill Joy 6/21/85

  parent reply	other threads:[~2004-09-07  7:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-07  4:09 [U-Boot-Users] Size and format of standalone apps Robin Gilks
2004-09-07  5:04 ` Marc Leeman
2004-09-08 22:01   ` Robin Gilks
2004-09-09  0:17     ` Wolfgang Denk
2004-09-07  7:23 ` Wolfgang Denk [this message]
2004-09-08 22:03   ` Robin Gilks
2004-09-09  0:16     ` Wolfgang Denk

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=20040907072402.1461EC1430@atlas.denx.de \
    --to=wd@denx.de \
    --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