1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-06 01:50:57 +11:00
collapseos/blk/092
Virgil Dupras 94cb76520a Refer to stable wordref by direct offset in "hot zone" immediates
Previously, it was impossible to cross-compile Collapse OS from a
binary-offsetted Collapse OS because stable ABI wordrefs would have
a wrongly offsetted address.

This solves the problem by replacing those wordrefs by direct,
hardcoded stable ABI offset references.
2020-07-05 07:09:11 -04:00

17 lines
791 B
Plaintext

Stable wordrefs are there for more complicated reasons. When
cross-compiling Collapse OS, we use immediate words from the
host and some of them compile wordrefs (IF compiles (?br),
LOOP compiles (loop), etc.). These compiled wordref need to
be stable across binaries, so they're part of the stable ABI.
Another layer of complexity is the fact that some binaries
don't begin at offset 0. In that case, the stable ABI doesn't
begin at 0 either. The EXECUTE word has a special handling of
those case where any wordref < 0x100 has the binary offset
applied to it.
But that's not the end of our problems. If an offsetted binary
cross compiles a binary with a different offset, stable ABI
references will be > 0x100 and be broken.
(cont.)