[comp.software-eng] Unix linker

vic@zen.UUCP (Victor Gavin) (02/29/88)

 > From: ok@quintus.UUCP (Richard A. O'Keefe)
... stuff about libraries and individual files ...
 >             Not because the linker is stupid, but because it is in
 > general impossible.

 Defeatist talk!

 > 			Suppose you have
 > 	cat <<EOF >foo.c
 > 	static f(...){...}
 > 	static g(...){...}
 > 	h(...){... f() ...}
 > 	i(...){... g() ...}
 > 	EOF
 > 
 > If you use h(), you'd like just h() and f(), right?  But how is the
 > linker supposed to know that h() uses f()?  The compiler has to tell
 > it, and UNIX compilers don't do that.

 True, but not relevant. Just because that's how it's done at the moment
doesn't mean that it is the best (in the Unix linkers case, just the simple).

 >  					In fact, there's no law that
 > says a smart compiler can't notice that h() and i() look pretty similar
 > and decide to share some code between them.

 Again, very true but not relevant. If the compiler can be made smarter, then
the linker can be made equally as smart.

 The situation at the moment works and is very usable, but for some cases is
not the ideal solution. As an enhancement to the Unix system it would be an
excellent feature and would also have the virtue of being totally transparent.

	vic
--
Victor Gavin						Zengrange Limited
vic@zen.co.uk						Greenfield Road
..!mcvax!ukc!zen.co.uk!vic				Leeds LS9 8DB
+44 532 489048						England