Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

sum of segment size and executable size
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


Report this thread to moderator Post Follow-up to this message
Old Post
sachin_mzn@yahoo.com
12-30-04 08:58 AM


Re: sum of segment size and executable size
sachin_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


Report this thread to moderator Post Follow-up to this message
Old Post
Rich Gibbs
12-30-04 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:48 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.