From: Ingo Krabbe <ikrabbe.ask@web.de>
To: gcc-help@gcc.gnu.org
Subject: Re: Symbols which were not used, still in binary
Date: Thu, 29 Jun 2006 05:16:00 -0000 [thread overview]
Message-ID: <200606290716.34386.ikrabbe.ask@web.de> (raw)
In-Reply-To: <44A2F293.7353A1FF@dessent.net>
Am Mittwoch, 28. Juni 2006 23:20 schrieb Brian Dessent:
> Michael Eager wrote:
> > Arguably, the linker should know
> > that add is not referenced and could remove it, but linkers are not
> > usually able to slice and dice object files.
>
> You address this limitation by compiling with "-ffunction-sections
> -fdata-sections -Wl,--gc-sections". However, it's still better to use
> "static" on these kinds of local functions that are only used from the
> same .o file. This has a number of benefits:
>
> - it ensures that internal functions of a library are not exported for
> use by other code when they are not part of the defined ABI/API
> - it prevents them from taking up needless relocations, which can slow
> linking
> - when compiled -fpic (as in a shared library) it allows for direct
> calls to the function instead of having to go through the PLT which is
> slower
> - it allows the compiler freedom to inline
>
and you are warned about unused static symbols. hmm, reminds me of cleaning
my attic ...
> Brian
next prev parent reply other threads:[~2006-06-29 5:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-28 19:58 Steve Kreyer
2006-06-28 20:17 ` Michael Eager
2006-06-28 21:20 ` Brian Dessent
2006-06-29 5:16 ` Ingo Krabbe [this message]
2006-06-28 20:17 ` Brian Dessent
2006-06-28 21:21 ` Steve Kreyer
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=200606290716.34386.ikrabbe.ask@web.de \
--to=ikrabbe.ask@web.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).