public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Thiemo Seufer <ths@networkno.de>
To: Tzu-Chien Chiu <tzuchien.chiu@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: LD: function-level linking
Date: Mon, 10 Jul 2006 08:15:00 -0000	[thread overview]
Message-ID: <20060710081040.GK4375@networkno.de> (raw)
In-Reply-To: <4d77c5f20607092350j26ab6056t9c9a3b40fdb5493@mail.gmail.com>

Tzu-Chien Chiu wrote:
> Hello all.
> 
> I'm looking for a similar feature available in Visual C++.
> Function-level linking.
> 
> In Visual C++, there is an option "/Gy" which enables "function-level
> linking". That is, each function is packaged separately as a COMDAT,
> and later the linker option "/OPT:REF" eliminates the COMDATs which
> are never referenced.
> 
> FYI: http://msdn2.microsoft.com/en-us/library/bxwfs976.aspx
> 
> In this way, the entire object file won't have to be linked as a whole
> when only one of the functions in it is referenced. It's preferred
> linking for embedded system software. Not all libraries are design ed
> as glibc, which has a separate file for each file, and it's sometimes
> not easy or feasible to modify the source code of the libraries.
> 
> I can not find similar compiler and linker options in the GNU tool
> chain. What I missed?

There's gcc's -ffunction-sections, and ld's -Wl,--gc-sections.


Thiemo

  reply	other threads:[~2006-07-10  8:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-10  6:50 Tzu-Chien Chiu
2006-07-10  8:15 ` Thiemo Seufer [this message]
2006-07-10 14:37   ` Tzu-Chien Chiu
2006-07-10 14:44     ` Thiemo Seufer
2006-07-10 14:49       ` Tzu-Chien Chiu
2006-07-10 14:53         ` Tzu-Chien Chiu
2006-07-10 16:49     ` 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=20060710081040.GK4375@networkno.de \
    --to=ths@networkno.de \
    --cc=binutils@sourceware.org \
    --cc=tzuchien.chiu@gmail.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).