From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50084 invoked by alias); 20 Jul 2017 19:34:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 50034 invoked by uid 89); 20 Jul 2017 19:34:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_NEUTRAL autolearn=no version=3.3.2 spammy=Hx-languages-length:1130, our, executions X-HELO: hera.aquilenet.fr Date: Thu, 20 Jul 2017 19:34:00 -0000 From: Samuel Thibault To: Carlos O'Donell Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] Add RTLD_RELOAD to dlopen Message-ID: <20170720193428.qa6z7tvoq5xkssu6@var.youpi.perso.aquilenet.fr> References: <20170720191517.xah6rggoaeqgbokf@var.youpi.perso.aquilenet.fr> <169b9578-5546-2b44-1b5c-94e9215efc24@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <169b9578-5546-2b44-1b5c-94e9215efc24@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2017-07/txt/msg00754.txt.bz2 Carlos O'Donell, on jeu. 20 juil. 2017 15:31:38 -0400, wrote: > On 07/20/2017 03:15 PM, Samuel Thibault wrote: > > In our parallel programming projects, we would like to load some DSO > > several times within the same process, because we want to share the > > addresse space for passing data pointers between parallel executions, > > and the DSO has global variables and such which we want to see > > duplicated. > > > > Unfortunately, dlopen() does not re-load the DSO when it is already > > loaded. One workaround is to cp the file under another name, but that's > > ugly and does not share the memory pages. > > > > The patch proposed here simply adds an RTLD_RELOAD flag which disables > > checking for the DSO being already loaded, thus always loading the DSO > > again. There is no actual code modification, only the addition of two > > if()s and reindent. > > This is what Solaris designed dlmopen() for, is there any reason you > can't use dlmopen()? Because only that DSO should be reloaded. All the dependencies are fine to use as such, to avoid memory usage duplication. Samuel