From: Ruppert <ru@swb.siemens.de>
To: gcc-help@gcc.gnu.org
Subject: Re: Giant executables.. what am I doing wrong?
Date: Tue, 15 Oct 2002 05:31:00 -0000 [thread overview]
Message-ID: <200210151231.g9FCVCB25243@fiji.swb.siemens.de> (raw)
...
> If you run 'nm' on your pre-stripped executable you will see all the
> compiled in functions from the C library and any other libraries. When you
> do a static compile it doesn't just include only the needed function(s), but
> the entire C library .a file. That's why I recommended going with a smaller
> or more base-functionality C library such as newlib.
>
...
No. The linker will extract the modules from the archive file (.a)
on a "per object" base. Thus if you use strcpy in your program the
module which contains the definition of strcpy (usually strcpy.o)
gets copied from the archive file to your executable. A archive file
is, in fact, only a collection of individual objects pasted together
and augmented by a common table of symbols.
I would also recommend using 'nm'. This provides detailed insight into
what constitutes your executable.
-- D.Ruppert
next reply other threads:[~2002-10-15 12:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-15 5:31 Ruppert [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-10-14 19:00 Dockeen
2002-10-14 16:49 Michiel Buddingh'
2002-10-14 17:08 ` Joshua Nye
2002-10-14 17:21 ` Michiel Buddingh'
2002-10-14 17:35 ` Joshua Nye
2002-10-14 18:50 ` Michiel Buddingh'
2002-10-15 2:38 ` Claudio Bley
2002-10-15 5:15 ` Michiel Buddingh'
2002-10-15 5:12 ` Joshua Nye
2002-10-15 5:19 ` Joshua Nye
2002-10-15 5:20 ` Michiel Buddingh'
2002-10-15 3:53 ` Steve Dondley
2002-10-15 4:15 ` Claudio Bley
2002-10-15 5:09 ` Michiel Buddingh'
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=200210151231.g9FCVCB25243@fiji.swb.siemens.de \
--to=ru@swb.siemens.de \
--cc=gcc-help@gcc.gnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).