From: Laubzega Date: Sun, 26 Aug 2018 03:21:12 +0000 (-0700) Subject: Fix for multiple overlay segments. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1b0e2cf783751a0f3505b1986dcee13bed83db3e;p=cc65 Fix for multiple overlay segments. --- diff --git a/src/ld65/bin.c b/src/ld65/bin.c index 927719016..f4d241add 100644 --- a/src/ld65/bin.c +++ b/src/ld65/bin.c @@ -193,8 +193,8 @@ static void BinWriteMem (BinDesc* D, MemoryArea* M) NewAddr += M->Start; } if (DoWrite || (M->Flags & MF_FILL) != 0) { - /* Seek back for "overlay" segments */ - if (NewAddr < Addr) { + /* Seek in "overlay" segments */ + if (S->Flags & SF_OVERLAY) { fseek(D->F, NewAddr - M->Start, SEEK_SET); } else { WriteMult (D->F, M->FillVal, NewAddr-Addr);