public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
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: Fri, 28 Jul 2006 13:14:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.0607281452000.25141@wotan.suse.de> (raw)
In-Reply-To: <20060727171133.GA14609@lucon.org>

Hi,

On Thu, 27 Jul 2006, H. J. Lu wrote:

> > (no JUMP_SLOT, as expected that's now bound locally).  With -Bsymbolic the 
> > _ZTI1A reloc goes away, but the _ZTS1A remains.
> 
> Can you show me your example?

% cat header.h
struct A {
  int i;
  A(int i): i(i) {}
};

% cat lib.cpp
#include "header.h"
void f()
{
  throw (A(42));
}

% cat app.cpp
#include <stdio.h>
#include "header.h"
extern void f();
int main()
{
  try {
    f();
  } catch (A a) {
    printf ("Got A: %d\n", a.i);
  } catch (...) {
    printf ("Got something\n");
  }
  return 0;
}

> > 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.
> > 
> 
> The dynamic verion script doesn't imply -Bsymbolic and shouldn't be used 
> together with -Bsymbolic since -Bsymbolic will set DF_SYMBOLIC and 
> dynamic linker will treat the DSO differently.

Ah yes, I only mean the effect of -Bsymbolic to bind self-defined symbols 
locally.  I wonder if DT_SYMBOLIC makes a difference in the end.  During 
link editing all references to symbols defined in the DSO are bound 
locally by ld.  So there's no reference left for ld.so which could be 
satisfied by the DSO itself, hence it shouldn't matter that it comes first 
in the symbol search order with DT_SYMBOLIC.  Hmm.

> What it does is to bind all symbols locally except for which are 
> undefined or on the dynamic list.

With an empty dynamic list, isn't that exactly what -Bsymbolic does, 
ignoring the setting of DT_SYMBOLIC?

> BTW, I'd like to have a new option name and I am thinking to add an 
> option to make C++ symbols dynamic automatically. Does anyone have any 
> suggestions for new option name?

How do you envision should it work?  Would you implement a rule of what 
C++ symbols are in ld (i.e. something like the globs), or would you 
somehow mark the symbols in the compiler?  How about -dynamic-only-cpp or 
similar?


Ciao,
Michael.

  reply	other threads:[~2006-07-28 13:14 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
2006-07-27 17:11   ` H. J. Lu
2006-07-28 13:14     ` Michael Matz [this message]
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.0607281452000.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).