From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMGC6-0003n5-AE for qemu-devel@nongnu.org; Wed, 18 Sep 2013 07:45:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMGC0-0002Jk-A5 for qemu-devel@nongnu.org; Wed, 18 Sep 2013 07:45:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMGC0-0002JY-0c for qemu-devel@nongnu.org; Wed, 18 Sep 2013 07:45:12 -0400 Message-ID: <52399246.4090600@redhat.com> Date: Wed, 18 Sep 2013 13:45:10 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20130916095121.GD22783@T430s.nay.redhat.com> <5236D8EB.9060700@redhat.com> <20130916101415.GH6005@redhat.com> <5236DB0E.5040302@redhat.com> <20130916102131.GI6005@redhat.com> <5236DDC7.1010908@redhat.com> <20130916112917.GA21374@T430s.nay.redhat.com> <5236EC72.20900@redhat.com> <20130916114641.GA22477@T430s.nay.redhat.com> <523786DD.5020406@twiddle.net> <20130917012910.GB3362@T430s.nay.redhat.com> <5237EB64.9030206@twiddle.net> In-Reply-To: <5237EB64.9030206@twiddle.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: peter.maydell@linaro.org, famz@redhat.com, mjt@tls.msk.ru, qemu-devel@nongnu.org, alex@alex.org.uk, vilanova@ac.upc.edu Il 17/09/2013 07:40, Richard Henderson ha scritto: > On 09/16/2013 06:29 PM, Fam Zheng wrote: >>> Link spice-qemu.char.so against spice-core.so. The DT_NEEDED entry will be >>> recorded, and ld.so will do the right thing. >>> >>> Anything else sounds way too much like Not Invented Here. >>> >> How to do the symbol checking as above if spice-core.so is automatically loaded >> by ld.so? > > You're checking the version stamp in spice-char.so. I'd think that's good > enough. No need to transitively check. > >> And we will need to add $moddir to LD_LIBRARY_PATH and lose the restriction of >> modules directory too. > > Or add DT_RUN_PATH to the main executable, or even add DT_RUN_PATH to the > module itself. In particular, link the module with > > -Wl,--enable-new-dtags -Wl,-rpath,'$ORIGIN' > > and dependencies for the module will automatically be looked for in the > directory in which the module is found. Which is almost certiainly the only > thing that we want -- all modules in the same directory. This is not portable. It looks like it can be emulated on Windows using LoadLibraryEx with the LOAD_WITH_ALTERED_SEARCH_PATH flag and passing an absolute path to the shared library. But on Mac OS X a bundle (module loaded with dlopen) cannot have a dependency on another bundle, afaik. Paolo