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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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: enabling caching for dl_iterate_phdr()


On Fri, Jan 16, 2004 at 04:57:26PM -0800, Roland McGrath wrote:
> > In any case, if a callback-based approach is preferred, I can live
> > with that, too.
> 
> I don't claim it's the best interface.  But that is the approach that
> doesn't have other blocking issues right now.

How about extending struct dl_phdr_info and passing an counter in it
to dl_iterate_phdr's callback?
The structure can be extended at the end, because dl_iterate_phdr
passes its size to the callback as well.
The callback is called with dl_load_lock held, so the counter doesn't
even have to be atomic.
libgcc_s would just see if size includes the additional field in the
first callback, if yes, it would record that counter and on subsequent
dl_iterate_phdr call it would first check whether the counter did not
change and if it is the same, it could use cached info.

	Jakub


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