From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32008 invoked by alias); 22 Jan 2004 08:39:24 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 31873 invoked from network); 22 Jan 2004 08:39:22 -0000 Received: from unknown (HELO sunsite.ms.mff.cuni.cz) (195.113.19.66) by sources.redhat.com with SMTP; 22 Jan 2004 08:39:22 -0000 Received: from sunsite.ms.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8) with ESMTP id i0M6TktV006338; Thu, 22 Jan 2004 07:29:46 +0100 Received: (from jakub@localhost) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8/Submit) id i0M6Tjn6006336; Thu, 22 Jan 2004 07:29:45 +0100 Date: Thu, 22 Jan 2004 08:39:00 -0000 From: Jakub Jelinek To: davidm@hpl.hp.com Cc: Roland McGrath , GNU libc hackers Subject: Re: enabling caching for dl_iterate_phdr() Message-ID: <20040122062944.GC6811@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek References: <16387.9755.753294.37588@napali.hpl.hp.com> <200401170057.i0H0vQag022225@magilla.sf.frob.com> <20040116232931.GL6413@sunsite.ms.mff.cuni.cz> <16399.6885.708290.614809@napali.hpl.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16399.6885.708290.614809@napali.hpl.hp.com> User-Agent: Mutt/1.4i X-SW-Source: 2004-01/txt/msg00084.txt.bz2 On Wed, Jan 21, 2004 at 04:35:49PM -0800, David Mosberger wrote: > --- elf/link.h 16 Sep 2003 05:48:04 -0000 1.76 > +++ elf/link.h 22 Jan 2004 00:26:54 -0000 > @@ -100,6 +100,12 @@ > const char *dlpi_name; > const ElfW(Phdr) *dlpi_phdr; > ElfW(Half) dlpi_phnum; > + > + /* Note: older versions of libc do not provide the following > + members. Check the SIZE argument pass to the dl_iterate_phdr() > + callback to determine whether or not they areprovided. */ > + unsigned int dlpi_adds; /* incremented when phdrs may have been added */ > + unsigned int dlpi_subs; /* incremented when phdrs may have been removed */ I'd make the counters unsigned long long instead to avoid wrap around. Also, could you write a testcase for it? dl_iterate_phdr, then dlopen some shlib in elf, then dl_iterate_phdr again, check the counters, dlclose etc. Jakub