Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Packaging tool
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: malc <malc@p...>
Subject: Re: [Caml-list] Packaging tool
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)

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


Bug reports:  FAQ:
To unsubscribe, mail  Archives: