From 262c4235dfd41eead0e5702c0510b7ed72fc6962 Mon Sep 17 00:00:00 2001 From: acqn Date: Tue, 21 Jan 2020 10:50:12 +0800 Subject: [PATCH] Symbols in ZP segments will use '.exportzp' instead of '.export' if exported. --- src/cc65/compile.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/cc65/compile.c b/src/cc65/compile.c index 00e78c2bd..ec90e4b2d 100644 --- a/src/cc65/compile.c +++ b/src/cc65/compile.c @@ -37,6 +37,7 @@ #include /* common */ +#include "addrsize.h" #include "debugflag.h" #include "segnames.h" #include "version.h" @@ -275,6 +276,17 @@ static void Parse (void) } Entry->V.BssName = xstrdup (bssName); + /* This is to make the automatical zeropage setting of the symbol + ** work right. + */ + g_usebss (); + } + } + + /* Make the symbol zeropage according to the segment address size */ + if ((Entry->Flags & SC_EXTERN) != 0) { + if (GetSegAddrSize (GetSegName (CS->CurDSeg)) == ADDR_SIZE_ZP) { + Entry->Flags |= SC_ZEROPAGE; /* Check for enum forward declaration. ** Warn about it when extensions are not allowed. */