This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

RE: [PATCH v3 1/3] elf: Allow dlopen of filter object to work [BZ #16272]


> -----Original Message-----
> From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
>
> > diff --git a/elf/dl-deps.c b/elf/dl-deps.c
> > index c29b988..bb85c83 100644
> > --- a/elf/dl-deps.c
> > +++ b/elf/dl-deps.c
> > @@ -550,13 +550,14 @@ Filters not supported with
> LD_TRACE_PRELINKING"));
> >      }
> >
> >    /* Maybe we can remove some relocation dependencies now.  */
> > -  assert (map->l_searchlist.r_list[0] == map);
> 
> Ok, the first entry is the filtee object.
> 
> >    struct link_map_reldeps *l_reldeps = NULL;
> >    if (map->l_reldeps != NULL)
> >      {
> > -      for (i = 1; i < nlist; ++i)
> > +      for (i = 0; i < nlist; ++i)
> >  	map->l_searchlist.r_list[i]->l_reserved = 1;
> >
> > +      /* Avoid removing relocation dependencies of the main binary.
> */
> > +      map->l_reserved = 0;
> >        struct link_map **list = &map->l_reldeps->list[0];
> >        for (i = 0; i < map->l_reldeps->act; ++i)
> >  	if (list[i]->l_reserved)
> > @@ -581,16 +582,32 @@ Filters not supported with
> LD_TRACE_PRELINKING"));
> >  	      }
> >  	  }
> >
> > -      for (i = 1; i < nlist; ++i)
> > +      for (i = 0; i < nlist; ++i)
> >  	map->l_searchlist.r_list[i]->l_reserved = 0;
> >      }
> 
> I am trying to understand why we can't skip first element here. Neither
> of the tests actually exercise this code patch (they won't add a
> dependency on l_reldeps), so could you provide an example/testcase
> where it requires such change?

I haven't observed the use case that this code handles. I just tried to
maintain the existing behaviour that we avoid doing this for the main object.

I've been trying to understand what triggers this, but not getting very far.
Does anyone have any hints as to how I need to setup the test so that we do
trigger relocation removals?


Thanks,

Dave.

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