TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Mike Bilow
from: Philipp Thomas
date: 1995-03-15 03:20:54
subject: Smart Linking

Hello Mike!

Tuesday February 28 1995 00:02, Mike Bilow wrote to Russell Coker:

 MB> Proper behavior for the linker is to bring in any OBJ module referenced by
 MB> name, whether used or not.  There is no such thing as an optimizing
 MB> linker.
[.....]
 MB> That is, any reference to any symbol in an OBJ module in a LIB should
 MB> cause that whole OBJ module to be brought in.


Be carefull, a linker does some optimizing. e.g far call optimizing or
deciding what compression to use (for /EXEPACK:2 ). And MS introduced
funtion level linking back in MSC 7.0. The trick is quite simple. The
compiler will, if given the /Gy switch, wrap every function in a comdat
record. This makes the whole function visible to the linker, who will not
link in functions that aren't called. So function level *is* possible in C.
It's just so, that not many compilers implement them.

 MB> If you want efficient linking, you have to separate your code into
 MB> different source files as much as possible so that these source files will
 MB> be compiled into many more and smaller OBJ files.

Yes, but the tradeoff is speed. There more granular you make a lib, the
longer the linking will take.

                                                     Philipp


=============================================================================
Remember that whatever misfortune may be your lot, it could only be worse
in Cleveland.
=============================================================================

--- GoldED/2 2.50.Beta5+
* Origin: Time Bandit, watch your Time or ... (2:2437/221)
SEEN-BY: 105/42 620/243 624/50 711/401 409 410 413 430 807 808 809 934 955
SEEN-BY: 712/407 515 628 704 713/888 800/1 7877/2809
@PATH: 2437/221 200 501 2461/200 24/999 240/5002 5500 396/1 270/101 105/103
@PATH: 105/42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.