From 1b0e2cf783751a0f3505b1986dcee13bed83db3e Mon Sep 17 00:00:00 2001 From: Laubzega Date: Sat, 25 Aug 2018 20:21:12 -0700 Subject: [PATCH] Fix for multiple overlay segments. --- src/ld65/bin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.5