From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11104 invoked by alias); 28 Jul 2008 08:36:32 -0000 Received: (qmail 11096 invoked by uid 22791); 28 Jul 2008 08:36:32 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 28 Jul 2008 08:36:09 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m6S8a6eF025661; Mon, 28 Jul 2008 04:36:06 -0400 Received: from zebedee.pink (vpn-12-103.rdu.redhat.com [10.11.12.103]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m6S8a5sA016388; Mon, 28 Jul 2008 04:36:05 -0400 Message-ID: <488D84EA.2060003@redhat.com> Date: Mon, 28 Jul 2008 09:39:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: eoin CC: gcc-help@gcc.gnu.org Subject: Re: gcc the gnu linker and the -z extract option References: <18635245.post@talk.nabble.com> In-Reply-To: <18635245.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-07/txt/msg00288.txt.bz2 eoin wrote: > I'm a new poster here. I am porting some Solaris code over to Linux and > using the GNU compiler and linker. Now I have a "meta library"(creating a > "master" shared object from mayny shared objects) which creates fine in > Solaris but in Linux it doesn't create as a meta library - ldd suggests that > it depends on the libraries which were previously used to produce the meta > library on solaris. What should be in this meta library? Is it all the contents of all the libraries? > Looking into this I can see that with every .so we effectively lose the > identity and so with a metalibrary what we need to do is to "unravel" the > .sos to produce the meta library. "Lose the idenitity?" I don't know what you mean. > I do this in Solaris using the -z extract option. I can't see how to do > this in Linux using the GNU linker. Compile every .o file with -fpic. Make them all into archives with ar. Link all the archives together into a .so. Andrew.