Linux binary size after strip

Javier Cabezas Rodríguez jcabezas@ac.upc.edu
Fri Nov 24 10:07:00 GMT 2006


El mié, 22-11-2006 a las 08:42 -0800, H. J. Lu escribió:
> On Wed, Nov 22, 2006 at 05:36:27PM +0100, Javier Cabezas Rodríguez wrote:
> > El mié, 22-11-2006 a las 16:03 +0000, Nick Clifton escribió:
> > > Hi Javier,
> > > 
> > > > Now I have stripped some of these sections, but the size of the binary
> > > > has not decreased. 
> > > 
> > > Possibly the sections have alignment requirements so that after 
> > > stripping they are still padded out to some fixed size ?
> > 
> > Each section has a 4096 alignment requirement, but they are 4096bytes
> > sized too, so it should not be a problem. I have attached the "readelf
> > -Sl" output of each kernel.
> > 
> > 1- Original kernel:       2396464 bytes
> > 2- Partitioned kernel: 2144924 bytes
> > 3- Stripped kernel:       2143660 bytes
> > 
> > > Possibly the kernel is already frugal with the symbols and debug 
> > > information it exports and there is nothing to strip.
> > 
> > The sections I want to strip only contain code (initially located in
> > the .text section). The debug sections are already stripped in standard
> > kernels.
> > 
> 
> Please send me the original kernel and the command you used to
> strip it.

Hi,

I have found that "du" gives the real size of the binary. I think it is
because all the emptied sections are replaced by zero-sized blocks. But,
couldn't them be deleted too? Will the loader copy this zero-sized
blocks into memory? It would be a problem, since we want to reduce the
size of the binary and its loading time.

Best regards.

Javi

-- 
Javier Cabezas Rodríguez
Phd. Student - DAC (UPC)
jcabezas@ac.upc.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje est? firmada	digitalmente
URL: <https://sourceware.org/pipermail/binutils/attachments/20061124/57997cce/attachment.sig>


More information about the Binutils mailing list