public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Dave Gotwisner" <Dave.Gotwisner@harmonicinc.com>
To: <gcc-help@gcc.gnu.org>
Subject: Linker question about global vs. local symbols
Date: Fri, 30 Sep 2005 01:07:00 -0000	[thread overview]
Message-ID: <0C8BDDA8FCFB5E46926F13A25D0B2F20012354E6@SV-EXCH.hlit.local> (raw)

I have a C++ embedded application which has a TON of symbols.  Because
of the way the target must be built, our link phase takes about 20
minutes on a Sun.  Several thousand of the symbols are currently global
but can be made local, because they are only used from the one source
file that contains them.  When developing and fixing bugs, we may do
compile / link cycles many times in a day. 

From what I understand, all symbols (both local and global) always
appear in the symbol table for the GNU tool chain.  (Older compilers I
worked with didn't expose any local symbols outside of the .o). 

Would link times get reduced by making a large % of the symbols that are
currently global into local (ie, static) symbols?  Does the linker do a
filtering pass that walks all the objects and libraries in question to
build a list of global symbols that it later works on rather than always
trying to resolve each symbol off the full list? 

Splitting the app into smaller executables isn't possible because of the
architecture and cross dependencies. 

Any info anyone can give would be appreciated. 

Thanks,
	Dave

             reply	other threads:[~2005-09-30  1:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-30  1:07 Dave Gotwisner [this message]
2005-09-30  5:03 ` Ian Lance Taylor

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=0C8BDDA8FCFB5E46926F13A25D0B2F20012354E6@SV-EXCH.hlit.local \
    --to=dave.gotwisner@harmonicinc.com \
    --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).