From: "H.J. Lu" <hjl.tools@gmail.com>
To: Petr Baudis <pasky@ucw.cz>
Cc: Roland McGrath <roland@hack.frob.com>,
"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 23:30:00 -0000 [thread overview]
Message-ID: <CAMe9rOpHweZuwSxhHwPCSRq09RupFyshcp42JXDjUA7nk-Ut3A@mail.gmail.com> (raw)
In-Reply-To: <20120420225444.GP24309@machine.or.cz>
On Fri, Apr 20, 2012 at 3:54 PM, Petr Baudis <pasky@ucw.cz> wrote:
> On Fri, Apr 20, 2012 at 01:11:34PM -0700, H.J. Lu wrote:
>> On Fri, Apr 20, 2012 at 12:50 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> > Please provide an example that illustrates why you think you need this.
>> >
>>
>> 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.
>
> This is still a very general example. Does this concern a particular
> software package?
We have a compiler optimization feature which requires a backup
definition just in case that the primary one doesn't exist in an archive
or a DSO.
> Couldn't you use IFUNC to perform the if-statement above and supply
> the proper function?
No.
--
H.J.
next prev parent reply other threads:[~2012-04-20 23:30 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
2012-04-20 20:36 ` H.J. Lu
2012-04-20 22:55 ` Petr Baudis
2012-04-20 23:30 ` H.J. Lu [this message]
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=CAMe9rOpHweZuwSxhHwPCSRq09RupFyshcp42JXDjUA7nk-Ut3A@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=binutils@sourceware.org \
--cc=gcc@gcc.gnu.org \
--cc=libc-alpha@sourceware.org \
--cc=pasky@ucw.cz \
--cc=roland@hack.frob.com \
--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).