From: Michael Matz <matz@suse.de>
To: "H. J. Lu" <hjl@lucon.org>
Cc: binutils@sources.redhat.com
Subject: Re: RFC: Add dynamic list to version script
Date: Wed, 26 Jul 2006 16:42:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.64.0607261822590.25141@wotan.suse.de> (raw)
In-Reply-To: <20060724221020.GA22024@lucon.org>
Hi H.J.,
On Mon, 24 Jul 2006, H. J. Lu wrote:
> Here is a prototype, which added dynamic list to version script. I used
>
> {
> dynamic:
> extern "C++"
> {
> *typeinfo*;
> };
> };
>
> It seems to work correctly with execptions between shared C++ libraries.
Yep. Though it slightly changes the output even without using a version
script but using -Bsymbolic. For instance a very simple library defining
just one class 'A' with a ctor has this set of interesting relocs without
the patch, without any flag:
000017a0 00001201 R_386_32 00000730 _ZTS1A
00001884 00001506 R_386_GLOB_DAT 0000179c _ZTI1A
0000189c 00001407 R_386_JUMP_SLOT 000006ca _ZN1AC1Ei
With -Bsymbolic (still not applied the patch) this changes as expected to:
000018a0 00000008 R_386_RELATIVE
000018a4 00000008 R_386_RELATIVE
(and no JUMP_SLOT entry for the ctor), i.e. all three references are bound
locally. When the patch is applied, no version script is used, but
-Bsymbolic I have this set of relocs:
000018a4 00000008 R_386_RELATIVE
00001790 00001201 R_386_32 00000720 _ZTS1A
So, no reference to the typeinfo node or the ctor anymore, locally bound.
But still a reference to the typeinfo name symbol. As said, with
-Bsymbolic and no version script. I think some of the (info->dynamic &&
!h->dynamic) conditions are wrong. With a version script I get this set
of relocs:
00001790 00001201 R_386_32 00000720 _ZTS1A
00001874 00001506 R_386_GLOB_DAT 0000178c _ZTI1A
(no JUMP_SLOT, as expected that's now bound locally). With -Bsymbolic the
_ZTI1A reloc goes away, but the _ZTS1A remains.
I find the overloading of semantics a bit confusing. I mean that using a
version script with the "dynamic" tag implicitely has the effect of
-Bsymbolic without actually mentioning that flag. This means that an
empty version script using the "dynamic" tag is the opposite of using no
version script. Perhaps such version script should only have an effect if
the user also specifies -Bsymbolic (i.e. creating exceptions to the
-Bsymbolic symbol set). OTOH it's documented so it's not that important.
Oh, and yes, throwing exceptions does work, while without the version
script it does not :-) Nice.
Ciao,
Michael.
next prev parent reply other threads:[~2006-07-26 16:42 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-24 22:27 H. J. Lu
2006-07-25 12:53 ` Ulrich Drepper
2006-07-25 13:49 ` H. J. Lu
2006-07-25 14:04 ` Ulrich Drepper
2006-07-25 14:36 ` H. J. Lu
2006-07-25 14:49 ` Ulrich Drepper
2006-07-26 16:42 ` Michael Matz [this message]
2006-07-27 17:11 ` H. J. Lu
2006-07-28 13:14 ` Michael Matz
2006-07-28 17:40 ` H. J. Lu
2006-07-28 17:59 ` Ulrich Drepper
2006-07-28 18:05 ` H. J. Lu
2006-08-08 17:22 ` H. J. Lu
2006-08-08 18:49 ` Michael Matz
2006-08-09 20:36 ` PATCH: Add --dynamic-list to ld H. J. Lu
2006-09-07 15:28 ` Nick Clifton
2006-09-07 19:41 ` H. J. Lu
2006-09-08 8:17 ` Nick Clifton
2006-10-10 15:50 ` [PATCH] Fix --dynamic-list Jakub Jelinek
2006-10-11 15:39 ` Nick Clifton
2006-10-16 22:45 ` H. J. Lu
2006-10-18 18:19 ` Nick Clifton
2006-08-09 2:02 ` RFC: Add dynamic list to version script Alan Modra
2006-08-09 16:05 ` Michael Matz
2006-08-09 16:19 ` Alan Modra
2006-08-09 17:40 ` H. J. Lu
2006-08-09 16:25 ` 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=Pine.LNX.4.64.0607261822590.25141@wotan.suse.de \
--to=matz@suse.de \
--cc=binutils@sources.redhat.com \
--cc=hjl@lucon.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).