From: Keir Fraser Subject: Re: dynamic libraries Date: Wed, 23 Feb 2005 23:08:19 +0000 Message-ID: <137edce4961c1b2972cb01dff8265db4@cl.cam.ac.uk> References: <20050223212813.GA3988@liz.veritas.com> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <20050223212813.GA3988@liz.veritas.com> Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Andrei Petrov Cc: xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org On 23 Feb 2005, at 21:28, Andrei Petrov wrote: > While looking at tools build I noticed that same object files are used > to build both > static and dynamic libraries (libxc, libxutil). It's normally required > to compile in > PIC form for dynamic ones. At first I thought that no applcations use > those libraries, > but no, they are used by all of them. Surprisingly it doens't cause > any problems (at > least nobody's complaining, ld.so even). > > Well, anyway it doesn't look correct for me, I'd like to come up with > a patch > but it'll take some time, so I wouldn't mind if some Makefile savvy > beat me on it. > Short term solution would be always set -fPIC. Well, we have the functionality in the build system already; it just isn't the default. Where is it stated that dynamic libraries must be compiled -fPIC? They contain relocation info and so can be relocated wherever needed at run time. Potentially less efficient (library relocated to different addresses cannot have its text pages shared across processes) but I don't see why it is *disallowed*. If there's a suitably convincing explanation/reason then I will change the default setting. :-) -- Keir ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click