[U-Boot-Users] Size and format of standalone apps

Wolfgang Denk wd at denx.de
Tue Sep 7 09:23:57 CEST 2004


Dear Robin,

in message <413D346D.2030606 at 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




More information about the U-Boot mailing list