c - SIze of .s file larger than .o file linux -
i compiling program find maximum of numbers in array.
edited
i compiled follows:
gcc --save-temps max.c -o max
and on doing
ls -l max*
the output was:
-rwxrwxr-x 1 tapan tapan 7296 aug 16 01:45 max -rw-rw-r-- 1 tapan tapan 233 aug 16 01:45 max.c -rw-rw-r-- 1 tapan tapan 17894 aug 16 01:45 max.i -rw-rw-r-- 1 tapan tapan 1308 aug 16 01:45 max.o -rw-rw-r-- 1 tapan tapan 1507 aug 16 01:45 max.s
my question is: why size of .s assembly file larger .o binary file?
i thought .o file has binary strings larger.
also final file max has larger size expected due linked libraries. size of .o file makes me think .o file doesn't have binary strings else. please correct me if wrong somewhere.
if "binary strings" mean ascii-encoded (i.e. each 0 or 1 ascii characters 0x30 , 0x31) can open file in text editor , see 0001011011111101011101100...
, no. have @ cat
or od
(if you're on unix) or hex editor, contains binary data "directly". opcode 01001010
takes one byte in binary file, not 8 ascii characters take 1 byte each.
Comments
Post a Comment