Does gnu ld link in whole object files or only the needed functions?
问题 We have a library and an executable, that is to be statically linked to the lib. We want to minimize the program space of the final executable. According to avr-libc's documentation: the linker links in THE ENTIRE OBJECT MODULE in which the function is located On the other hand, my colleagues are unanimous on the point that at some pass, the linker throws away any unused functions. So who is correct or am I misunderstanding something? Is the answer consistent throughout gcc or are we talking