Code Comments
Programming Forum and web based access to our favorite programming groups.Hi,
why I am getting different size value if i run "size" command and if i
see using "ls -l" on an object file.
my.c file contains only one empty function
my.c
f()
{
}
The Output of size command on HPUX
$ size my.o
8 + 0 + 0 = 8 ( here 8 is text segment size, rest is 0 )
$ ls -l my.o
-rw-rw-r-- 1 odcqa1 users 696 Dec 30 11:41 my.o
Can any one explain me? Why the size of my.o is larger than total of
it's segment's size.
-Sachin
Post Follow-up to this messagesachin_mzn@yahoo.com said the following, on 12/30/04 01:22:
> Hi,
> why I am getting different size value if i run "size" command and if i
> see using "ls -l" on an object file.
>
> my.c file contains only one empty function
> my.c
>
> f()
> {
> }
> The Output of size command on HPUX
>
> $ size my.o
> 8 + 0 + 0 = 8 ( here 8 is text segment size, rest is 0 )
>
> $ ls -l my.o
> -rw-rw-r-- 1 odcqa1 users 696 Dec 30 11:41 my.o
>
> Can any one explain me? Why the size of my.o is larger than total of
> it's segment's size.
>
Because the object file contains header information in addition to the
actual executable code and data. For example, it probably contains
things like a "magic number" (for 'file'), the size data that 'size'
prints, an external symbol table, and so on.
--
Rich Gibbs
rgibbs@alumni.princeton.edu
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.