public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@hack.frob.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "Ansari, Zia" <zia.ansari@intel.com>,
	   GCC Development <gcc@gcc.gnu.org>,
	   GNU C Library <libc-alpha@sourceware.org>,
	   Binutils <binutils@sourceware.org>
Subject: Re: RFC: Add STB_GNU_SECONDARY
Date: Fri, 20 Apr 2012 20:27:00 -0000	[thread overview]
Message-ID: <20120420202647.C35192C0D7@topped-with-meat.com> (raw)
In-Reply-To: H.J. Lu's message of  Friday, 20 April 2012 13:11:34 -0700 <CAMe9rOreQ2E7-xSAS6Tqu0qgqQ7oMQJ53hZ10zvYMuwWfVyHow@mail.gmail.com>

> Currently we use weak undefined symbol, foo, to do
> 
> if (&foo != 0)
>  foo is defined.
> else
>  foo isn't defined.
> 
> We want is to define foo as a secondary symbol so that
> we can always use foo without checking.  If there is a primary
> one in a .o file and .so file, we will get the primary one,
> otherwise, we will use the secondary one.

Why not use a weak definition in the file where you make the call?

  reply	other threads:[~2012-04-20 20:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 19:47 H.J. Lu
2012-04-20 19:51 ` Roland McGrath
2012-04-20 20:11   ` H.J. Lu
2012-04-20 20:27     ` Roland McGrath [this message]
2012-04-20 20:36       ` H.J. Lu
2012-04-20 22:55     ` Petr Baudis
2012-04-20 23:30       ` H.J. Lu
2012-04-20 20:56 ` Joern Rennecke
2012-04-20 21:20   ` H.J. Lu
2012-04-20 22:11     ` Cary Coutant
2012-04-20 22:48       ` H.J. Lu
2012-04-20 22:49         ` H.J. Lu
2012-04-20 22:59         ` Ian Lance Taylor
2012-04-20 23:36           ` H.J. Lu
2012-04-20 23:40             ` Ian Lance Taylor
2012-04-20 23:51               ` H.J. Lu
2012-04-21  0:49                 ` Ian Lance Taylor
2012-04-21  1:04                   ` H.J. Lu
2012-04-21  1:07                     ` Ian Lance Taylor
2012-04-21  1:09     ` Joern Rennecke
2012-04-21 13:53       ` H.J. Lu
2012-04-21 19:01         ` Joern Rennecke
2012-04-23 18:12           ` H.J. Lu

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=20120420202647.C35192C0D7@topped-with-meat.com \
    --to=roland@hack.frob.com \
    --cc=binutils@sourceware.org \
    --cc=gcc@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=zia.ansari@intel.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).