Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What exactly does the size command (sans any flags) return in linux? if we are using a compiled assembler sourcecode, will this return the size useded by the program?

many thanks

share|improve this question

migrated from stackoverflow.com Dec 8 '09 at 12:45

This question came from our site for professional and enthusiast programmers.

4  
what does "man size" say? –  nb2580 Dec 8 '09 at 12:36
    
The question would be more convincing if you said you had already tried man size and didn't understand something in the information provided. As it is, the best answer is repeating the information from the man page. –  Pascal Cuoq Dec 8 '09 at 12:37
1  
lol, man size... almost as humorous as touch me –  Ben Everard Dec 8 '09 at 12:37
    
sorry, i did try man size - and ive tried it witha number of complied programs "size - list section sizes and total size. " is from the manual, but i cant make much headway with determining what this is measuring. thanks –  dr_the_aregentinian Dec 8 '09 at 12:38
    
The command "man elf" will give you more information on object internal format. If it looks involved and complicated, it is. –  kmarsh Dec 8 '09 at 13:47

1 Answer 1

From the man page:

GNU size utility lists the section sizes---and the total size---for each of the object or archive files objfile in its argument list. By default, one line of output is generated for each object file or each module in an archive.

Here's an example output from running size foo.static

text data bss dec hex filename 6803811 221704 3419168 10444683 9f5f8b foo.static

This gives you the size of the text segment (also known as code segment), data segment, block started by symbol. dec is the size of the text, data and bss size added together. hex is the same number in hexadecimal.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.