linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: linuxppc-dev@lists.linuxppc.org
Subject: Re: dead code removal
Date: Thu, 25 Nov 1999 01:53:32 -0500	[thread overview]
Message-ID: <19991125015332.A22068@drow.res.cmu.edu> (raw)
In-Reply-To: <383C8C6B.97F4CF60@kerbango.com>; from reekes@kerbango.com on Wed, Nov 24, 1999 at 05:10:03PM -0800


That kind of stripping can not be done by the compiler.  It could
theoretically be done by the linker, and there MIGHT be a linker option
to give the warnings you want - what if another object file in your
program called DummyFunc?  Or worse, what if a shared library expected
DummyFunc to be available?


On Wed, Nov 24, 1999 at 05:10:03PM -0800, Jim Reekes wrote:
> 
> I have a little program that contains a routine DummyFunc() which is
> never reference in the code. Building this single source file in any way
> I've tried results in a binary which contains DummyFunc(). Using nm and
> objdump, as far as I can determine GCC 2.95 does not dead-code strip.
> (which I find amazing!). So I have two questions.
> 
> Am I missing something and GCC actually does dead-code stripping?
> 
>  - or - 
> 
> How can I find unused/unreferenced symbols in my code so that I can bury
> the dead code manually?
> 
> 
> Jim
> 
> P.S. I have always compared programming to ditch digging, and now I'm
> convinced.
> 


Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~1999-11-25  6:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-25  1:10 dead code removal Jim Reekes
1999-11-25  6:53 ` Daniel Jacobowitz [this message]
1999-11-25 22:32   ` Jeffrey Karl Lassahn
1999-12-18 20:08     ` Jeremy Fitzhardinge

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=19991125015332.A22068@drow.res.cmu.edu \
    --to=drow@false.org \
    --cc=linuxppc-dev@lists.linuxppc.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 NNTP newsgroup(s).