From cf7f7b9ef2a73e564fb68d4b33b605b3af1067ca Mon Sep 17 00:00:00 2001 From: Greg King Date: Wed, 10 Jul 2013 02:37:09 -0400 Subject: [PATCH] Fixed ld65's precalculation of memory-area sizes. Before this fix, BSS-type and ZP-type segments never were counted. Now, they are counted if their memory areas are filled. (It must be done because their places in the output file are filled.) The fix allows us to build programs for the CBM510 and CBM610 platforms. We won't see an "Internal error" diagnostic message about a bad file-offset. --- src/ld65/config.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ld65/config.c b/src/ld65/config.c index 76518cafd..a5d6ff39b 100644 --- a/src/ld65/config.c +++ b/src/ld65/config.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2012, Ullrich von Bassewitz */ +/* (c) 1998-2013, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -1959,8 +1959,11 @@ unsigned CfgProcess (void) /* Calculate the new address */ Addr += S->Seg->Size; - /* If this segment goes out to the file, increase the file size */ - if ((S->Flags & SF_BSS) == 0 && S->Load == M) { + /* If this segment will go out to the file, or its place + * in the file will be filled, then increase the file size. + */ + if (S->Load == M && + ((S->Flags & SF_BSS) == 0 || (M->Flags & MF_FILL) != 0)) { M->F->Size += Addr - StartAddr; } -- 2.39.5