public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rafael.espindola at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/47247] Linker plugin specification makes it difficult to handle COMDATs
Date: Mon, 14 Feb 2011 20:34:00 -0000	[thread overview]
Message-ID: <bug-47247-4-kBryXSXLKK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47247-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47247

--- Comment #12 from Rafael Avila de Espindola <rafael.espindola at gmail dot com> 2011-02-14 19:59:22 UTC ---
A quick summary to see if got this right:

Currently the linker has three options for a symbol in a comdat:

*) pick one not in the IL. The plugin gets a PREEMPTED_REG
*) pick one in the IL and give PREVAILING_DEF to the plugin
*) as above, but PREVAILING_DEF_IRONLY

The first one is undesirable since the more LTO sees, the better.
The second one prevents gcc from dropping tho symbol if it drops the uses.
To give the third option the plugin would have to know the semantics of this
symbol (available anywhere it is used).

The proposal is that PREVAILING_DEF_IRONLY_EXP will let gcc drop all references
if it drops all uses.

Some cases:

*) a visible symbol in IL and there is a reference from it in a ELF file. Gold
must give PREVAILING_DEF to the plugin and it cannot drop it.
*) a visible symbol in IL and there is no references from it in a ELF file.
Gold gives PREVAILING_DEF_IRONLY_EXP to the plugin. What gcc can do then
depends on what the symbol is
  1) if the symbol is one (like vtable) known to be available where it is
needed, gcc can drop it if it drops all uses
  2) if the symbol is a simple weak symbol gcc must keep it
*) a local symbol. gold gives PREVAILING_DEF_IRONLY to the plugin and it can do
anything it wants with it.

On LLVM land I think this translates to

*) If given PREVAILING_DEF, linkonce gets upgrade to weak and linkonce_odr to
weak_odr
*) If given PREVAILING_DEF_IRONLY_EXP, likages stay as they are
*) If given PREVAILING_DEF_IRONLY the symbol gets internalized

I think this should work, thanks.


  parent reply	other threads:[~2011-02-14 19:59 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10 16:51 [Bug lto/47247] New: " hubicka at gcc dot gnu.org
2011-01-10 17:02 ` [Bug lto/47247] " hubicka at gcc dot gnu.org
2011-01-10 17:11 ` hjl.tools at gmail dot com
2011-01-10 17:12 ` hjl.tools at gmail dot com
2011-01-10 17:13 ` hubicka at ucw dot cz
2011-01-10 17:19 ` hjl.tools at gmail dot com
2011-01-10 18:20 ` hubicka at gcc dot gnu.org
2011-01-10 18:36 ` hjl.tools at gmail dot com
2011-01-10 19:06 ` ccoutant at gcc dot gnu.org
2011-01-10 19:08 ` ccoutant at gcc dot gnu.org
2011-01-10 21:27 ` hjl.tools at gmail dot com
2011-01-10 21:27 ` hubicka at gcc dot gnu.org
2011-02-14 20:34 ` rafael.espindola at gmail dot com [this message]
2011-02-15 18:51 ` hubicka at ucw dot cz
2011-02-15 19:45 ` rafael.espindola at gmail dot com
2011-02-16  0:23 ` hubicka at ucw dot cz
2011-02-16  4:04 ` rafael.espindola at gmail dot com
2011-02-16  7:59 ` hubicka at ucw dot cz
2011-02-16 16:23 ` rafael.espindola at gmail dot com
2011-02-16 23:13   ` Jan Hubicka
2011-02-16 23:18 ` hubicka at ucw dot cz
2011-02-16 23:37 ` ccoutant at google dot com
2011-02-17  1:25 ` rafael.espindola at gmail dot com
2011-08-27 18:16 ` hubicka at gcc dot gnu.org
2011-09-26 21:47 ` ccoutant at gcc dot gnu.org
2011-09-27  0:23 ` ccoutant at gcc dot gnu.org
2011-09-28 13:09 ` hubicka at gcc dot gnu.org
2011-10-02 10:42 ` hubicka at gcc dot gnu.org
2012-05-10  7:32 ` vincenzo.innocente at cern dot ch
2012-05-10  7:54 ` rguenth at gcc dot gnu.org
2012-05-10  8:52 ` vincenzo.innocente at cern dot ch
2012-05-10 16:06 ` vincenzo.innocente at cern dot ch
2012-05-10 17:10 ` hubicka at ucw dot cz
2012-05-10 17:17 ` vincenzo.innocente at cern dot ch
2012-05-12 14:37 ` hubicka at gcc dot gnu.org
2012-05-14  8:13 ` vincenzo.innocente at cern dot ch

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=bug-47247-4-kBryXSXLKK@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).