public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Lam <jlam555@yahoo.com>
To: John Carter <john.carter@tait.co.nz>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Linking un-referenced function
Date: Tue, 23 May 2006 19:35:00 -0000	[thread overview]
Message-ID: <20060523193529.73582.qmail@web31711.mail.mud.yahoo.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0605231249590.18842@parore>

Thanks for the quick response, John.

It looks like these options will arrange the functions
to different sections in the final image but it still
doesn't exclude them.  Am I missing something?

Thanks,

Jason

--- John Carter <john.carter@tait.co.nz> wrote:

> On Mon, 22 May 2006, Jason Lam wrote:
> 
> > I looked through the documents and couldn't find
> an
> > option to not link an un-referenced function into
> the
> > final image.  Does GCC support it?  Could someone
> > please help?
> 
> Sorry, I got confuddled...
> 
> Use
>    `--gc-sections'
> option on linker and...
> 
> 
> `-ffunction-sections'
> `-fdata-sections'
>       Place each function or data item into its own
> section in the output
>       file if the target supports arbitrary
> sections.  The name of the
>       function or the name of the data item
> determines the section's name
>       in the output file.
> 
>       Use these options on systems where the linker
> can perform
>       optimizations to improve locality of reference
> in the instruction
>       space.  Most systems using the ELF object
> format and SPARC
>       processors running Solaris 2 have linkers with
> such optimizations.
>       AIX may have these optimizations in the
> future.
> 
>       Only use these options when there are
> significant benefits from
>       doing so.  When you specify these options, the
> assembler and
>       linker will create larger object and
> executable files and will
>       also be slower.  You will not be able to use
> `gprof' on all
>       systems if you specify this option and you may
> have problems with
>       debugging if you specify both this option and
> `-g'.
> 
> 
> John Carter                             Phone :
> (64)(3) 358 6639
> Tait Electronics                        Fax   :
> (64)(3) 359 4632
> PO Box 1645 Christchurch                Email :
> john.carter@tait.co.nz
> New Zealand
> 
> Carter's Clarification of Murphy's Law.
> 
> "Things only ever go right so that they may go more
> spectacularly wrong later."
> 
> From this principle, all of life and physics may be
> deduced.
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

  parent reply	other threads:[~2006-05-23 19:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-22 23:31 Jason Lam
2006-05-23  0:49 ` John Carter
2006-05-23  0:53 ` John Carter
2006-05-23  8:58   ` Shriramana Sharma
2006-05-23 19:35   ` Jason Lam [this message]
2006-05-23 21:11 Meissner, Michael
2006-05-23 23:29 ` Jason Lam

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=20060523193529.73582.qmail@web31711.mail.mud.yahoo.com \
    --to=jlam555@yahoo.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=john.carter@tait.co.nz \
    /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).