From: Jason Merrill <jason@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: GNU C Library <libc-alpha@sources.redhat.com>, gcc@gcc.gnu.org
Subject: Re: PATCH: Treat RTLD_LOCAL like Solaris (Re: Duplicate data objects in shared libraries)
Date: Thu, 10 Apr 2003 15:31:00 -0000 [thread overview]
Message-ID: <wvl3ckqfrft.fsf@prospero.boston.redhat.com> (raw)
In-Reply-To: <wvlit54530i.fsf@prospero.cambridge.redhat.com> (Jason Merrill's message of "Fri, 31 May 2002 00:56:29 -0400")
On Fri, 31 May 2002 00:56:29 -0400, Jason Merrill <jason@redhat.com> wrote:
>>>>>> "Ulrich" == Ulrich Drepper <drepper@redhat.com> writes:
>
> Thanks for responding.
>
>> On Thu, 2002-05-30 at 13:01, Jason Merrill wrote:
>
>>> No; Solaris' behavior is no more helpful for real-world C++ examples.
>
>> Very specialized and maybe true for gcc.
>
> The EDG frontend, used by Intel among many others, also relies on address
> comparison for typeinfos. And, indeed, the Intel compiler produces code
> that fails in exactly the same way as the gcc output.
>
> Intel also seems to use weak symbols, and even linkonce sections, for
> template instantiations.
>
> Sun CC 4.2 fails in the same way under Solaris 5.8 (after I make the
> necessary changes to accomodate that ancient compiler; fortunately, it
> supports EH).
>
> Interestingly, SGI CC 7.30 passes the test, even though it also uses the
> EDG frontend. I'll investigate why; I'm guessing dlopen works differently
> on Irix.
>
>>> Is there any kind of a standard for ld.so symbol resolution behavior?
>
>> Most things the generic ELF ABI covers. But the behavior of dlopen() on
>> the ELF level is not covered by any standard.
>
>>> 1) Always prefer the last weak definition if no strong definition is seen.
>
>> Special weak symbol handling is going away. The ELF spec didn't clearly
>> state what has to happen and so a few implementation (like glibc) added
>> this kind of support. But it's not portable and it's unnecessarily
>> reducing the speed.
>
> It's not portable because, as you say, there's no standard. That seems
> like an opportunity to explore what a future standard should say.
>
> Speed should not trump correctness. If you have a different idea for how
> we can get proper C++ semantics, I'd love to hear it.
>
>>> 2) If a DSO A has two unrelated dependencies B and C which both define (and
>>> use) the same weak symbol, add C to the dependency list of this loaded
>>> copy of B.
>
>> If I understand this correctly you mean
>
>> A ---> B
>> |
>> +--> C
>
>> and B defines and uses 'foo' and C defines and uses 'foo'.
>
>> In this case it makes no difference whether C gets added to the
>> dependency list of B since B's scope comes first.
>
> Yes, I mentioned that this was only meaningful in conjunction with #1,
> which would cause the last definition to be chosen.
>
>>> 3) When resolving a relocation from a DSO loaded with RTLD_LOCAL, start
>>> looking from the DSO itself; do not consider other RTLD_LOCAL objects
>>> which depend on it.
>
>> Starting with the DSO itself is what you select with DF_SYMBOLIC. It's
>> generally a very bad idea. Which other scopes are searched depends
>> heavily on the actual situation. There won't be any "this is how C++
>> needs it and therefore this is how it's gonna be".
>
> Of course not, I'm mostly looking for input. But C++ places more complex
> demands on the linker, leading to situations that we hadn't considered
> before; we need to consider what the right thing to do is in those
> situations. I've suggested what I think the right thing is, which I
> believe is appropriate for all languages, not just C++, but I'm very
> interested in your opinion; you are certainly more familiar with ld.so than
> I.
>
>> I'll look at all this hopefully in two weeks from now.
>
> Thanks.
Ping?
Jason
next prev parent reply other threads:[~2003-04-10 12:51 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <09b501c1f634$04747d80$6501a8c0@boostconsulting.com>
2002-05-12 4:57 ` Minimal GCC/Linux shared lib + EH bug example Jason Merrill
2002-05-12 6:42 ` David Abrahams
2002-05-12 7:30 ` Jason Merrill
2002-05-12 7:31 ` David Abrahams
2002-05-12 8:07 ` Jason Merrill
2002-05-12 9:24 ` David Abrahams
2002-05-12 9:31 ` Martin v. Loewis
2002-05-12 9:34 ` David Abrahams
2002-05-12 12:17 ` Mark Mitchell
2002-05-12 12:24 ` Martin v. Loewis
2002-05-12 12:29 ` Mark Mitchell
2002-05-12 12:36 ` Jason Merrill
2002-05-12 12:37 ` Mark Mitchell
2002-05-12 16:55 ` Jason Merrill
2002-05-12 13:41 ` David Abrahams
2002-05-13 1:34 ` Martin v. Loewis
2002-05-13 2:05 ` Mark Mitchell
2002-05-13 5:44 ` David Abrahams
2002-05-13 16:58 ` Martin v. Loewis
2002-05-13 21:39 ` David Abrahams
2002-05-14 2:34 ` Martin v. Loewis
2002-05-14 13:12 ` David Abrahams
2002-05-14 14:17 ` Martin v. Loewis
2002-05-12 12:36 ` David Abrahams
2002-05-13 1:28 ` Martin v. Loewis
2002-05-13 5:00 ` David Abrahams
2002-05-13 16:50 ` Martin v. Loewis
2002-05-13 19:00 ` David Abrahams
2002-05-14 2:14 ` Martin v. Loewis
2002-05-14 6:07 ` David Abrahams
2002-05-14 13:53 ` Martin v. Loewis
2002-05-14 14:45 ` David Abrahams
2002-05-15 2:54 ` Martin v. Loewis
2002-05-14 15:28 ` Jason Merrill
2002-05-14 18:32 ` Daniel Jacobowitz
2002-05-15 1:34 ` Martin v. Loewis
2002-05-14 13:23 ` Sean Parent
2002-05-14 14:08 ` David Abrahams
2002-05-14 18:38 ` Sean Parent
2002-05-14 22:50 ` David Abrahams
2002-05-15 11:38 ` Sean Parent
2002-05-15 11:50 ` Matthew Austern
2002-05-15 12:29 ` Joe Buck
2002-05-15 17:26 ` David Abrahams
2002-05-15 20:21 ` H . J . Lu
2002-05-15 22:35 ` David Abrahams
2002-05-16 11:18 ` H . J . Lu
2002-05-18 16:53 ` David Abrahams
2002-05-18 17:55 ` Martin v. Loewis
2002-05-18 19:06 ` David Abrahams
2002-05-19 4:18 ` Duplicate data objects in shared libraries Martin v. Loewis
2002-05-19 5:00 ` David Abrahams
2002-05-19 5:14 ` Martin v. Loewis
2002-05-19 5:48 ` David Abrahams
2002-05-19 15:05 ` Martin v. Loewis
2002-05-20 1:42 ` Jason Merrill
2002-05-20 3:47 ` H . J . Lu
2002-05-20 4:08 ` Mark Mitchell
2002-05-20 9:55 ` Jason Merrill
2002-05-20 10:15 ` Mark Mitchell
2002-05-20 12:42 ` Jason Merrill
2002-05-20 12:53 ` Mark Mitchell
2002-05-20 13:23 ` Jason Merrill
2002-05-20 13:28 ` David Abrahams
2002-05-22 16:35 ` Jason Merrill
2002-05-22 21:46 ` David Abrahams
2002-05-22 23:05 ` Jason Merrill
[not found] ` <20020529130945.A16909@lucon.org>
[not found] ` <039401c20759$a3ba1400$6601a8c0@boostconsulting.com>
[not found] ` <wvl8z615rsz.fsf@prospero.cambridge.redhat.com>
[not found] ` <1022790116.22692.205.camel@myware.mynet>
2002-05-30 18:51 ` PATCH: Treat RTLD_LOCAL like Solaris (Re: Duplicate data objects in shared libraries) Jason Merrill
[not found] ` <wvlit54530i.fsf@prospero.cambridge.redhat.com>
2002-05-31 0:28 ` Jason Merrill
2002-05-31 0:39 ` Ulrich Drepper
2003-04-10 15:31 ` Jason Merrill [this message]
2003-04-10 15:32 ` H. J. Lu
2003-04-10 16:20 ` H. J. Lu
2002-05-20 7:42 ` Duplicate data objects in shared libraries David Abrahams
2002-05-20 9:34 ` Jason Merrill
2002-05-20 9:57 ` David Abrahams
2002-05-20 10:28 ` H . J . Lu
2002-05-20 13:49 ` Jason Merrill
2002-05-20 13:59 ` H . J . Lu
2002-05-20 14:17 ` Jason Merrill
2002-05-20 18:19 ` H . J . Lu
2002-05-20 14:32 ` David Abrahams
2002-05-20 14:32 ` David Abrahams
2002-05-20 15:31 ` Martin v. Loewis
2002-05-21 19:07 ` H . J . Lu
2002-05-22 1:46 ` Martin v. Loewis
2002-05-20 13:26 ` David Beazley
2002-05-20 13:57 ` H . J . Lu
2002-05-20 14:36 ` David Beazley
2002-05-20 15:50 ` Michael Matz
2002-05-18 19:13 ` Minimal GCC/Linux shared lib + EH bug example David Abrahams
2002-05-19 4:29 ` Martin v. Loewis
2002-05-19 5:10 ` David Abrahams
2002-05-19 14:48 ` Martin v. Loewis
2002-05-15 16:36 ` David Abrahams
2002-05-15 19:26 ` Jeff Sturm
2002-05-12 8:17 ` Martin v. Loewis
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=wvl3ckqfrft.fsf@prospero.boston.redhat.com \
--to=jason@redhat.com \
--cc=drepper@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=libc-alpha@sources.redhat.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).