From: Shriramana Sharma <samjnaa@gmail.com>
To: Linux C Programming List <linux-c-programming@vger.kernel.org>
Subject: Does GCC link only used functions?
Date: Sun, 29 Jan 2006 14:38:17 +0530 [thread overview]
Message-ID: <200601291438.17093.samjnaa@gmail.com> (raw)
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
next reply other threads:[~2006-01-29 9:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-29 9:08 Shriramana Sharma [this message]
2006-01-29 16:23 ` Does GCC link only used functions? Steve Graegert
2006-01-29 18:17 ` Glynn Clements
2006-02-02 5:17 ` Hendrik Visage
2006-02-02 16:39 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200601291438.17093.samjnaa@gmail.com \
--to=samjnaa@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.