Hello.
I've read somewhere that the executable is smaller if we use a source file
for each function!
So, I tested this with gcc and it seams to confirm! What seams to happen is
that if we call a function from a source-files that defines 3 others, the
linkers includes the code of all the 4 functions, even if the on we call
doesn't rely on the others!
What do you people think about this?
Is there any way to make the linker reject all the code that isn't needed?
If there isn't any other answer to this, I may in the future create a small
app that could be used in release mode to separate all the functions in
their own files and compile all of it.
Please state your opinions and theorys about this.
PS: If someone wants it I can make the test project available.
I've read somewhere that the executable is smaller if we use a source file
for each function!
So, I tested this with gcc and it seams to confirm! What seams to happen is
that if we call a function from a source-files that defines 3 others, the
linkers includes the code of all the 4 functions, even if the on we call
doesn't rely on the others!
What do you people think about this?
Is there any way to make the linker reject all the code that isn't needed?
If there isn't any other answer to this, I may in the future create a small
app that could be used in release mode to separate all the functions in
their own files and compile all of it.
Please state your opinions and theorys about this.
PS: If someone wants it I can make the test project available.
Comment