diff --git a/mos-platform/atari8/link.ld b/mos-platform/atari8/link.ld index 12cf8299b..237cfd00d 100644 --- a/mos-platform/atari8/link.ld +++ b/mos-platform/atari8/link.ld @@ -30,8 +30,11 @@ OUTPUT_FORMAT { SHORT(_start) /* Address where first byte of main segment should be loaded. */ SHORT(0x2000) - /* Address of last byte of main segment. */ - SHORT(__data_end - 1) + /* Address of last byte of main segment. + -- is a hack to force the early evalutation of __data_end; otherwise the + -1 offset may be interpreted as requesting the end of the containing + section. */ + SHORT(--__data_end - 1) TRIM(ram) }