From owner-freebsd-hackers Thu Nov 23 5:48:28 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (pool56-tch-1.Sofia.0rbitel.net [212.95.170.56]) by hub.freebsd.org (Postfix) with SMTP id 2760137B4C5 for ; Thu, 23 Nov 2000 05:48:22 -0800 (PST) Received: (qmail 8964 invoked by uid 1000); 23 Nov 2000 13:47:48 -0000 Date: Thu, 23 Nov 2000 15:47:48 +0200 From: Peter Pentchev To: Konstantin Chuguev Cc: Dmitry Sychov , hackers@FreeBSD.ORG Subject: Re: dlopen() Message-ID: <20001123154748.C7746@ringworld.oblivion.bg> Mail-Followup-To: Konstantin Chuguev , Dmitry Sychov , hackers@FreeBSD.ORG References: <001001c05552$45913f80$0e61bec3@dima> <3A1D1E52.95A9E626@dante.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3A1D1E52.95A9E626@dante.org.uk>; from Konstantin.Chuguev@dante.org.uk on Thu, Nov 23, 2000 at 01:40:34PM +0000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Nov 23, 2000 at 01:40:34PM +0000, Konstantin Chuguev wrote: > Dmitry Sychov wrote: > > > Greetings. > > > > Is it safe to remove the *.so file after it is loaded > > into the process space and addresses to its > > functions are gotten? > > It's safe to remove it as soon as it's been opened. > The file will still exist in the filesystem, only there won't be any > references to it from any directories, so you won't be able to open it > by its name. The file will be really removed from the file system when > you close your file descriptor. So the original poster's question is better translated as 'does the dynamic loader ever close and reopen a file after the initial loading, so it could accidentally open the new version of the library and use the old addresses'? I'd guess the answer is 'no' - the dynamic loader most probably opens the file once, and mmap()'s the needed functions; I might very well be wrong though. G'luck, Peter -- This sentence is false. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message