comp.lang.ada
 help / color / mirror / Atom feed
From: "Rego, P." <pvrego@gmail.com>
Subject: Re: Size optimization for objects
Date: Wed, 10 Jul 2013 04:57:26 -0700 (PDT)
Date: 2013-07-10T04:57:26-07:00	[thread overview]
Message-ID: <63b8f2ef-5f9b-45b5-8d40-2eec7f32f11b@googlegroups.com> (raw)
In-Reply-To: <b3qtkjFhc0tU1@mid.individual.net>

> > and the read size of bla.o is 611 bytes.
> What do you mean by "read size"? Perhaps this is a typo, and you meant
> to write "real size"?
> If you mean the total size of the file bla.o (from the directory
> listing, e.g "ls -l"), this is not a useful comparison, because the file
> contains much more data than just the machine code: there are headers,
> symbol tables, and other debug information -- among other things, the
> information that "nm" uses to associate machine code addresses with
> identifier symbols.

Yes, it is from directory listing. In this case, the 'size' provided by "ls -l" should be bigger, right? 

> > If I add the second values,
> > the total result is 16#44" which is 68 in decimal, which is not 611 bytes.
> > Also, if I run 
> >    nm --print-size --size-sort bla.exe > bla.txt
> > the bla.parse is big,

> What do you mean by "bla.parse"? Perhaps "bla.txt"? The size of this
> text file is totally irrelevant.
Sorry, I meant "bla.txt". I agree, it was just a comment.

> > but adding the second column, the result (in Excel I convert it
> > to decimal before adding) is 8.61147E+12 and the real bla.exe
> > size is 1512500 bytes, also very different.
> Again, if by "real size" you mean the entire size of the file bla.exe,
> the comparison it not useful, just as for bla.o: bla.exe contains a lot
> more data than just the machine code.
I don't think 8.61147E+12 is irrelevant. Again, if you consider the lots of things added by "ls -l", the size of bla.exe should be bigger.
 
> The Excel summed size that you show is surprising. Perhaps the method
> "nm" uses to compute function size (as the difference between to
> adjacent symbols) does not work correctly for some special case, such as
> the function with the highest address. Without seeing the whole output
> from "nm", it is difficult to say.
Since the output is big, I will paste it in the next post.

> To find the total amount of data/code, in an exe, I would look either at
> the link map output, or use "objdump" to see the sizes of the segments.
I will run objdump so.

Thanks.

Rego.

> -- 
> 
> Niklas Holsti
> 
> Tidorum Ltd
> 
> niklas holsti tidorum fi
> 
>       .      @       .


  reply	other threads:[~2013-07-10 11:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 19:49 Size optimization for objects Rego, P.
2013-06-29  7:10 ` Georg Bauhaus
2013-07-01 13:56   ` Rego, P.
2013-07-01 16:49     ` G.B.
2013-06-29  9:48 ` Jack Daniels
2013-07-01 13:58   ` Rego, P.
2013-06-30 11:34 ` rrr.eee.27
2013-07-01 14:35   ` Rego, P.
2013-07-01 15:28     ` Niklas Holsti
2013-07-01 16:35       ` Rego, P.
2013-07-01 18:21         ` Niklas Holsti
2013-07-02 20:32           ` Rego, P.
2013-07-06 16:06             ` Niklas Holsti
2013-07-10 11:57               ` Rego, P. [this message]
2013-07-10 11:58                 ` Rego, P.
2013-07-11  9:10                   ` Niklas Holsti
2013-07-18 14:09                     ` Rego, P.
2013-07-18 14:10                       ` Rego, P.
2013-07-11  8:35                 ` Niklas Holsti
2013-07-12  0:35                   ` Randy Brukardt
2013-07-18 15:16                     ` Rego, P.
2013-07-18 15:12                   ` Rego, P.
2013-07-18 17:57                     ` Niklas Holsti
2013-07-19  5:02                     ` Randy Brukardt
2013-07-19 13:20                       ` Eryndlia Mavourneen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox