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 WAA26282; Thu, 3 Jan 2002 22:05:25 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA26394 for ; Thu, 3 Jan 2002 22:05:24 +0100 (MET) Received: from relay.rinet.ru (relay.rinet.ru [195.54.192.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g03L5Mb10990 for ; Thu, 3 Jan 2002 22:05:23 +0100 (MET) Received: (from uucp@localhost) by relay.rinet.ru (8.11.6/8.11.6) with UUCP id g03L5HY26652 for caml-list@inria.fr; Fri, 4 Jan 2002 00:05:17 +0300 (MSK) X-Envelope-To: caml-list@inria.fr Received: from dialin1.stormoff (rover1) [192.168.0.129] by stormoff with esmtp (Exim 3.12 #1 (Debian)) id 16MEza-00088S-00; Fri, 04 Jan 2002 00:01:39 +0300 X-Comment-To: malc To: caml-list@inria.fr Subject: Re: [Caml-list] Packaging tool References: From: Dmitry Bely In-Reply-To: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service (Windows)) Message-ID: Date: 04 Jan 2002 00:00:16 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk malc writes: > > 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 As for Windows, it really seems that there is no an equivalent tool in MSVC distribution. But fortunately both MSVC and gcc/Win32 use the same COFF format for object files, so one can use Cygwin or MinGW-compiled binutils to hack MSVC-produced files (can be taken from www.cygwin.com or www.mingw.org). Not very elegant, but it should work. Hope to hear from you soon, Dmitry ------------------- 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