reloc.1

On entry into the Forth process, all Forth word headers will be located at the page following the last byte used in list space. This is true for both the assembled (pre extended) Forth kernel and for the extended kernel. Prior to executing any Forth code, the kernel must first relocated all defined word headers from this location up into the allocated head space. As it does this all links associated with a given header will be adjusted to its new location.

When it comes time to fsave out a user executable (handled by one of the extensions) all word headers within head space must once again be relocated but this time in the other direction, from head space to the memory page immediatly following the last byte of used list space. The fsave operation can then save out all memory from address 0 (the elf headers) up to the last byte of the relocated headers.

These contortions are required because the ELF standard does not allow BSS sections to be interleaved with non BSS sections. IsForth requires list space (code) and head space (symbols) to be maintained within spearate memory areas with memory available for each of these to grow.