On Mon 04 Jun 2012 23:12, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo <wi...@pobox.com> skribis: > >> However something like '(1 . (2 . ())) has two pairs: the tail which has >> two immediates, and the head that has an immediate in the car but a >> pointer in the cdr. In that case you need to patch up the cdr to point >> to the tail, after you load the .go (or .so?) file. > > Actually, it could typically be patched by the loader, just like what > happens with the variables emitted by ‘SCM_IMMUTABLE_STRING’ and such, no? > > (Hmm, perhaps that’s what you meant?)
Yes, that is what I meant. Either you emit relocations into the ELF file, and rely on the dynamic loader to interpret them, or you compile a procedure to do the relocations and call it as an init function. Wip-rtl does the latter, because that way we can also do one-time initializations like string->symbol, string->number, etc. Andy -- http://wingolog.org/