caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: malc <malc@pulsesoft.com>
To: Xavier Leroy <xavier.leroy@inria.fr>
Cc: Ohad Rodeh <ORODEH@il.ibm.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Packaging tool
Date: Thu, 3 Jan 2002 18:29:23 +0300 (MSK)	[thread overview]
Message-ID: <Pine.LNX.4.21.0201031826001.9474-100000@oyster> (raw)
In-Reply-To: <20020103151546.C19606@pauillac.inria.fr>

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
<eof>

(file retain)
X_A
<eof>

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


  reply	other threads:[~2002-01-03 15:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-29  8:39 Ohad Rodeh
2002-01-03 14:15 ` Xavier Leroy
2002-01-03 15:29   ` malc [this message]
2002-01-03 21:00     ` Dmitry Bely
2002-01-09 16:14 Ohad Rodeh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.21.0201031826001.9474-100000@oyster \
    --to=malc@pulsesoft.com \
    --cc=ORODEH@il.ibm.com \
    --cc=caml-list@inria.fr \
    --cc=xavier.leroy@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).