One strange problem is now less strange, though it remains a problem. Delegation works!
On the other hand, no-one's bitten on the strange "jump far into weeds" problem. What have we discovered so far?
call_into_lisp, the function that ends up jumping into Lispland, does so by an indirection. Relevant code snippets:
X86:
movl 8(%ebp),%eax # lexenv?
...
call *CLOSURE_FUN_OFFSET(%eax)
PPC:
lwz reg_CODE,SIMPLE_FUN_SELF_OFFSET(reg_LEXENV)
addi reg_LIP,reg_CODE,6*4-FUN_POINTER_LOWTAG
mtctr reg_LIP
slwi reg_NARGS,reg_NL2,2
bctr
A working Lisp image has the top-level function being referenced from very close to the top of dynamic space. My broken image has the top-level function very far from the top of dynamic space. This would tend to indicate that the PURIFY stage (when Lisp data are collected and anything remaining compacted) didn't work on the x86.
Here's where the fun begins: the changes involved didn't obviously touch the purify machinery at all. Investigations are ongoing, if hampered by the fact that I tried (three times, on three different architectures) to compile with the wrong patch installed. Hey ho.
