public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: jimmy <jimmyb@huawei.com>
Cc: Nick Clifton <nickc@redhat.com>,
	binutils@sourceware.org,         gcc-help@gcc.gnu.org
Subject: Re: dead function elimination
Date: Thu, 09 Nov 2006 10:15:00 -0000	[thread overview]
Message-ID: <17746.65461.468977.758976@zebedee.pink> (raw)
In-Reply-To: <4552F092.7020405@huawei.com>

jimmy writes:
 > Nick Clifton wrote:
 > > Hi Jimmy,
 > > 
 > >> Can gcc or ld perform dead procedure elimination apart from using the 
 > >> combination of --gc-sections/-ffunction-sections?
 > > 
 > > (Why are you excluding the --gc-sections / -ffunction-sections pairing 
 > > which were designed precisely for this purpose ?)
 > > 
 > > The short answer is yes.  Gcc can and will eliminate unused local 
 > > procedures, and with its --whole-program option it can even eliminate 
 > > unused non-local procedures.
 > > 
 > > But your question implies that you are asking if between them the linker 
 > > and compiler can eliminate unused procedures without recompilation of 
 > > all the sources, and in this case the answer is no.
 >
 > I thght the linker alone was supposed to be able to do 
 > dead-procedure-elimination. After all can't the linker determine which 
 > procedures are unreferenced in the final executable?
 > 
 > If i'm not mistaken the diablo linker can do this?

GNU ld can do this too.  It does it if you compile with
-ffunction-sections.

Andrew.

  reply	other threads:[~2006-11-09 10:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09  7:55 jimmy
2006-11-09  8:48 ` Nick Clifton
2006-11-09  9:20   ` jimmy
2006-11-09 10:15     ` Andrew Haley [this message]
2006-11-14 12:16     ` Nick Clifton
2006-12-18  8:24       ` jimmy
2006-12-19  1:09         ` Nick Clifton
2006-12-20  7:59           ` jimmy

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=17746.65461.468977.758976@zebedee.pink \
    --to=aph@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jimmyb@huawei.com \
    --cc=nickc@redhat.com \
    /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).