From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA21975; Thu, 3 Jan 2002 16:31:26 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA22173 for ; Thu, 3 Jan 2002 16:31:25 +0100 (MET) Received: from comtv.ru (mail.comtv.ru [217.10.32.4]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g03FVKH26134; Thu, 3 Jan 2002 16:31:24 +0100 (MET) Received: from [10.2.64.72] (HELO oyster2) by comtv.ru (CommuniGate Pro SMTP 3.4.7) with ESMTP id 1716301; Thu, 03 Jan 2002 18:31:19 +0300 Date: Thu, 3 Jan 2002 18:29:23 +0300 (MSK) From: malc X-Sender: malc@oyster To: Xavier Leroy cc: Ohad Rodeh , caml-list@inria.fr Subject: Re: [Caml-list] Packaging tool In-Reply-To: <20020103151546.C19606@pauillac.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 3 Jan 2002, Xavier Leroy wrote: > To work around this, we'd need to: > > 1- Synthesize a signature X.cmi for X that does not refer to A.cmi, etc. > This is fairly easy to do. > > 2- Generate an object file X.cmo or X.cmx/X.o that does not define > the global variables A, B, C. The easiest way to do this > (without recompiling the source files for A, B and C, of course!) > is to rename those global variables into, say, X.A, X.B, X.C. > No big deal for the bytecode compiler. But for the native-code > compiler, we need the ability to rename a symbol from a native object > file. And I haven't yet found a way to do this with standard > tools, neither under Unix nor Windows! (Under Unix, the GNU > binutils and the BFD library come close to allowing this, but > not quite.) Actually piece of cake with ELF/GNU binutils, consider this: (file a.s) .globl A A: nop (file retain) X_A rename$ as -o a.o a.s rename$ nm a.o 00000000 T A rename$ ld -r -o x_a.o --defsym X_A=A a.o --retain-symbols-file retain rename$ nm x_a.o 00000000 T X_A -- mailto:malc@pulsesoft.com ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr