Newsgroups: comp.os.msdos.djgpp From: Peter Berdeklis Subject: Re: OBJECTS, LIBRARIES, CODE SIZE, ETC. Message-ID: Nntp-Posting-Host: chinook.physics.utoronto.ca Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator) Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: University of Toronto - Dept. of Physics In-Reply-To: <3.0.1.32.19971007045314.0068c780@chasque.apc.org> Date: Wed, 8 Oct 1997 17:42:36 GMT References: <3 DOT 0 DOT 1 DOT 32 DOT 19971007045314 DOT 0068c780 AT chasque DOT apc DOT org> Lines: 24 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit Precedence: bulk On Tue, 7 Oct 1997 baldo AT chasque DOT apc DOT org wrote: > Hello. Now I have a curious question: why a lot of compilers canīt remove > individual functions from an object file? It would be nice to add a switch > to DJGPP to remove unused individual object functions in the linker. Maybe > this is not possible. If not why not? Goodbye! That would require a lot of information for the linker. What file scope variables does the function use? What is the start and end address of the function? What other functions in the file does the function require? This information is not currently kept in object files, and recording all the possible inter-dependencies could make the object files and the resulting libraries very large. The compiler/linker can't do all the work for you. At some point you've got to learn to code efficiently (time AND space) for yourself. --------------- Peter Berdeklis Dept. of Physics, Univ. of Toronto