Skip to content

Separate compilation on bee-asm branch #46

Open

Description

@rrthomas

Currently pForth is compiled to a single assembly file. If that file is split into two parts, primitives.s and highlevel.s, and those two parts are assembled separately, then the resulting object files can be linked to give an image with the following caveats:

  1. _does labels need to be public (this is only needed for _28_CREATE_29__does).
  2. --warn-unresolved-symbols must be passed to ld so that it does not give an error for all the undefined _compilation symbols.
  3. The files must be linked in the right order (bee-ld --warn-unresolved-symbols primitives.o highlevel.o) so that the word list links work. This could presumably be fixed by making those links symbolic (and global).
  4. The initial branch must be in the first file linked; maybe this could be fixed by calling it _start? Or does that not in itself cause the linker to put it first?
  5. POSTPONEd addresses would also need to be symbolic.
  6. Relatedly, it would be nice to use a suitable alignment directive instead of emitting 0x20 bytes for spaces in the header fields.

Activity

  1. rrthomas commented on Aug 10, 2020

    @rrthomas
    OwnerAuthor

    Also try separate compilation of applications, e.g. life.fs. Current problems:

    1. Multiple definitions (assembly and linking works with -z muldefs, but don't know yet if it does the right thing).
    2. Linking life.o with primitives.o and highlevel.o does not change the initial branch or dictionary list, so although the Life words are compiled into the image, they are not visible on start-up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions