This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
However why only destructors and constructors? This is not perfect world (I mean not all of the programmers are guru) and not all classes has such high cohesion to have no "unneeded" function members :)
With static linking all of the references to symbols are resolved at link-time and so the linker has the opportunity to detect and eliminate unused functions. (It needs assistance from the compiler in order to do this, since the linker has no knowledge of flow control or program semantics). With dynamically linked code, some of the symbol references are left unresolved until run-time and so the linker cannot know whether a particular function is unreachable. Hence it cannot eliminate anything.
I didn't understand that fully. How the dynamic library code can depend on functions inside user (my) program if the program doesn't export any symbols (entry points) ? I suppose when I do not export any entry points, my code can only call library functions and the library code cannot call ANY function within my program... So what is the problem to resolve the flow control ?
Cheers Nick
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |