In this article, I found this line: The GNU linker uses selective linking, which keeps other unreferenced functions out of the linker’s output image.
I am not sure what this means exactly. But what I think is, if I include stdio.h in my source code, and use only printf from that, then the resulting exe contains only code for printf extracted from stdio.c and other functions defined in that file are discarded.
Is what I say is correct? If not, what does selective linking mean? Also, in the above case, does compiler include entire file, or only the used functions?