This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Speeding up libstdc++.so with --dynamic-list-data


On Tue, Jan 09, 2007 at 06:18:19AM -0800, H. J. Lu wrote:
> On Tue, Jan 09, 2007 at 02:01:53PM +0000, Andrew Haley wrote:
> > H. J. Lu writes:
> >  > On Tue, Jan 09, 2007 at 01:51:00PM +0000, Andrew Haley wrote:
> >  > > H. J. Lu writes:
> >  > >  > On Tue, Jan 09, 2007 at 01:38:00PM +0000, Andrew Haley wrote:
> >  > >  > > H. J. Lu writes:
> >  > >  > >  > I am enclosing a patch to implement a new linker swicth,
> >  > >  > >  > --dynamic-list-data. It is -Bsymbolic for function symbols only.
> >  > >  > >  > I tried it with C, C++, Java and Fortran on Linux/ia32, Linux/x86-64
> >  > >  > >  > and Linux/ia64. There are only a few regressions. The function calls
> >  > >  > >  > within the new resulting DSOs will bind locally. It speeds up
> >  > >  > >  > the enclosed C++ testcase by
> >  > >  > >  > 
> >  > >  > >  > 1. 23% on ia64.
> >  > >  > >  > 2. 6% on ia32.
> >  > >  > >  > 3. 3% on x86-64.
> >  > >  > >  > 
> >  > >  > >  > Should we consider such optimization?
> >  > >  > > 
> >  > >  > > That's a terrible name for the option.  What does it mean?
> >  > >  > 
> >  > >  > It is an extension of the current command line options:
> >  > >  > 
> >  > >  >   --dynamic-list-cpp-typeinfo Use C++ typeinfo dynamic list
> >  > >  >   --dynamic-list FILE         Read dynamic list
> >  > > 
> >  > > But you said it was like -Bsymbolic for function symbols only.  What
> >  > > is the connection between C++ typeinfo and that?  (Hint: Java doesn't
> >  > > use C++ typeinfo, but -Bsymbolic for function symbols only would be
> >  > > very useful.)
> >  > 
> >  > --dynamic-list is a generic linker feature. Users have to provide a
> >  > list of symbols, which will be bound dynamically and everything else
> >  > is bound locally. --dynamic-list-cpp-typeinfo includes a prefined
> >  > list for C++ typeinfo. --dynamic-list-data puts data symbols on
> >  > the dynamic list.
> > 
> > OK, so in the case of --dynamic-list-data, there is no user-supplied
> > list.  Instead, there's (conceptually) an automatically-generated
> > list, which contains every symbol that doesn't point to a function.
> > Can't you just call the new option -Bsymbolic-functions?  At least
> > then people like me might have an outside chance of remembering it.
> 
> Here is the updated patch to use -Bsymbolic-functions instead.
> 

I just realized that --dynamic-list-data is -Bsymbolic for function
symbols only when you build shared libraries. We can use
--dynamic-list-data on executables to make global data symbols
dynamic so that dlopened shared libraries can reference them. We can
make -Bsymbolic-functions an alias of --dynamic-list-data. But
we still need --dynamic-list-data since -Bsymbolic doesn't apply to
executables.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]