In C programming, is there any way to determine how much a single source code file contributes to the final memory footprint?
Let us assume a simple C-program consisting of source files test1.c, test2.c, test3.c, and so on. The environment is Linux and the complier gcc.
With objdump
and readelf
can be seen see the total footprint and how the binary is distributed in .text
, .data
, and .bss
segments. But is it possible to see how much binary code is generated per test1.c, how much per test2.c, etc.?