Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22097

Why does a do-nothing program, written in C, take up 14KB even when compiled with -nostdlib option in GCC?

$
0
0

I was reading an article on static and dynamic linking of libraries in C which suggested that I should compile a program which simply returns 0 through the main function and compare its size with and without the -nostdlib option in GCC. The author's executable showed a drastic reduction (from 10KiB to 3KiB) whereas mine simply showed a reduction from 16KiB to 14KiB.

What is the reason behind this? Is this because of a change in the GCC versions used? If so, what's a do-nothing program have in it that takes up 14KiB?

EDIT: GCC Version 9.2.1, Ubuntu 19.10


Viewing all articles
Browse latest Browse all 22097


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>