From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21162 invoked by alias); 30 Mar 2017 19:37:43 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 20928 invoked by uid 89); 30 Mar 2017 19:37:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=freshly, intentions, H*r:TLS1.2, H*r:4.88 X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: albireo.enyo.de From: Florian Weimer To: "H.J. Lu" Cc: Suprateeka R Hegde , "Carlos O'Donell" , gnu-gabi@sourceware.org Subject: Re: RFC: ABI support for special memory area References: <88608944-14c9-9d28-80d1-32283521683b@gmail.com> <13b95ec6-45be-b02f-bb63-bc1835ecf396@redhat.com> Date: Sun, 01 Jan 2017 00:00:00 -0000 In-Reply-To: (H. J. Lu's message of "Mon, 20 Mar 2017 09:49:40 -0700") Message-ID: <87o9witv25.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-q1/txt/msg00029.txt.bz2 * H. J. Lu: > On Mon, Mar 20, 2017 at 7:57 AM, Florian Weimer wrote: >> On 03/16/2017 07:22 PM, H.J. Lu wrote: >> >>>> If the latter, why can't you use the existing ELF constructor mechanism >>>> for >>>> this? As far as I understand it, the call to __gnu_mbind_setup would >>>> just >>>> happen before the constructor calls. >>> >>> >>> That is correct. The issue is to access the ELF segment header for each >>> loaded object only once. There is no good way to get this info from >>> constructor. >> >> >> I think you can get the data in a pretty straightforward manner using >> dlinfo. > > dlinfo is used to info from application. I don't see how it can be used > here. You can get an opaque handle from an address and feed it into dlinfo. However, dlinfo only gives you access to the dynamic section, so unless you put your section markup there as well, it won't help you. I see that you are now considering dl_iterate_phdr, which gives you access to the program headers, from where you can walk the section headers. This looks like a good solution. >> I expect that libraries such as bdwgc might want to use the >> __gnu_mbind_setup callback as well, just to register freshly loaded shared > > Did you mean to mark pieces of memory garbage collectible? I guess it may > work. It's more for identifying roots to scan. >> objects and their data sections. Can we make this work for multiple users? >> > > What did you mean by "multiple users"? Different libraries installing different hooks with similar intentions.