crosstool bloat

Dave Korn dave.korn@artimi.com
Mon Sep 19 15:12:00 GMT 2005


----Original Message----
>From: David Karlton
>Sent: 19 September 2005 16:00


> You guys are my heroes. 

  LOL, save it for when/if we actually figure out what's going on!

> Program Header:
>      PHDR off    0x00000034 vaddr 0x00400034 paddr 0x00400034 align 2**2
>           filesz 0x000000e0 memsz 0x000000e0 flags r-x
>    INTERP off    0x00000114 vaddr 0x00400114 paddr 0x00400114 align 2**0
>           filesz 0x0000000d memsz 0x0000000d flags r--
> 0x70000000 off    0x00000144 vaddr 0x00400144 paddr 0x00400144 align 2**2
>           filesz 0x00000018 memsz 0x00000018 flags r--
>      LOAD off    0x00000000 vaddr 0x00400000 paddr 0x00400000 align 2**16
>           filesz 0x00000ac0 memsz 0x00000ac0 flags r-x
>      LOAD off    0x00010000 vaddr 0x10000000 paddr 0x10000000 align 2**16
>           filesz 0x00000090 memsz 0x000000a0 flags rw-

  Heh, gotcha!  Look at these two sections from the other (non-bloated)
version:


>      LOAD off    0x00000000 vaddr 0x00400000 paddr 0x00400000 align 2**12
>           filesz 0x00000950 memsz 0x00000950 flags r-x
>      LOAD off    0x00001000 vaddr 0x10000000 paddr 0x10000000 align 2**12
>           filesz 0x00000080 memsz 0x000000a0 flags rw-

  Notice how the LOAD offset for the second one has jumped from 0x1000 to
0x10000 (4kB->64kB) owing to the alignment requirement having changed from
2^12 to 2^16.

  I believe this confirms Mike's guess about the binutils version which was
stuffing executables with excess zero padding.  That would also explain why
zipping them works out at the same size: lots of continuous zeros zip down
to almost nothing.



>   DYNAMIC off    0x0000015c vaddr 0x0040015c paddr 0x0040015c align 2**2
>           filesz 0x000003a6 memsz 0x000003a6 flags rwx
>      NOTE off    0x00000124 vaddr 0x00400124 paddr 0x00400124 align 2**2
>           filesz 0x00000020 memsz 0x00000020 flags r--


> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>    0 .interp       0000000d  00400114  00400114  00000114  2**0
>                    CONTENTS, ALLOC, LOAD, READONLY, DATA

[snip]  These are all pretty-much the same size, give or take a few dozen
bytes, and the new .MIPS.stubs section which is also only a few dozen bytes,
so there isn't any new code or data in the executable; it really is just
padding, that should have been omitted.  I do remember hearing of this bug
before, although Mike seems more knowledgeable about it.  What version of
binutils are you using?  If there's a more recent release, try it; if not,
you should probably have a go with CVS HEAD, because I'm pretty sure the bug
got fixed.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list