This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


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

Re: An old dl patch


> 
> hjl@lucon.org (H.J. Lu) writes:
> 
> > --- dl-open.c	1998/03/31 16:18:44	1.1.1.5
> > +++ dl-open.c	1998/08/05 14:11:41
> > @@ -91,7 +91,14 @@ _dl_open (const char *file, int mode)
> >      }
> >  
> >    new->l_global = (mode & RTLD_GLOBAL) ? 1 : 0;
> > -  if (new->l_global)
> > +
> > +  if (_dl_loaded == new)
> > +    /* We are put at the first place on the global scope list, one way
> > +       or the other. We may be used by other shared objects. We have to
> > +       make sure that it stays in memory for them. Increment the open
> > +       count. */
> > +    new->l_opencount++;
> > +  else if (new->l_global)
> >      {
> >        /* The symbols of the new object and its dependencies are to be
> >  	 introduced into the global scope that will be used to resolve
> 
> This patch cannot be correct.  You simply ignore the the RTLD_GLOBAL
> flag and why modifying l_opencount?  This can only be a hack to work
> around a certain bug.
> 

I don't think checking the RTLD_GLOBAL flag is necessary since like it
or not, that shared object is put in the global scope in that
particular testcase. The real question is if you can remove it from the
global scope when it is not asked to be put in the global scope.

I will provide a new testcase after I rebuild glibc 2.

H.J.


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