All of lore.kernel.org
 help / color / mirror / Atom feed
* Does GCC link only used functions?
@ 2006-01-29  9:08 Shriramana Sharma
  2006-01-29 16:23 ` Steve Graegert
  2006-01-29 18:17 ` Glynn Clements
  0 siblings, 2 replies; 5+ messages in thread
From: Shriramana Sharma @ 2006-01-29  9:08 UTC (permalink / raw)
  To: Linux C Programming List

Hello list. I am relative newbie to GCC.

I have a C program which #includes a header file which in turn #includes many 
other header files. These header files are part of an open source library set 
I got from the net.

Now I do not use all the functions in the various libraries, but the makefile 
which came with the library of course has compile instructions for all the 
libraries. I have modified the makefile to compile my program using those 
libraries, but I did not remove the references to the libraries I knew I did 
not use, for I feared that some error may be caused.

But later I experimented removing some of the superfluous ones from the 
makefile and again "make"-d, and I got the same size executable as before.

So does this mean that GCC links only those functions from a library which I 
call directly or indirectly through another called function in the course of 
my program?

-- 

Penguin #395953 resides at http://samvit.org 
subsisting on SUSE Linux 10.0 with KDE 3.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-02-02 16:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-29  9:08 Does GCC link only used functions? Shriramana Sharma
2006-01-29 16:23 ` Steve Graegert
2006-01-29 18:17 ` Glynn Clements
2006-02-02  5:17   ` Hendrik Visage
2006-02-02 16:39     ` Glynn Clements

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.