Merge pull request #2690 from GorillaSapiens/issue_2608

fixes #2608
This commit is contained in:
Bob Andrews
2025-06-12 15:54:44 +02:00
committed by GitHub
3 changed files with 4 additions and 8 deletions

View File

@@ -434,13 +434,8 @@ static void ApplySegNamePragma (pragma_t Token, int PushPop, const char* Name, u
SetSegAddrSize (Name, AddrSize); SetSegAddrSize (Name, AddrSize);
} }
/* BSS variables are output at the end of the compilation. Don't
** bother to change their segment, now.
*/
if (Seg != SEG_BSS) {
g_segname (Seg); g_segname (Seg);
} }
}

View File

@@ -47,10 +47,11 @@ _Pragma _Pragma (
#pragma bss-name("BSS") #pragma bss-name("BSS")
{ {
extern int y; extern int y;
#pragma bss-name("BSS2") #pragma bss-name("BSS") // used to be BSS2, but fix for #2608 means
// that now causes ld65 to fail, so we use BSS instead
static static
#pragma zpsym ("y") #pragma zpsym ("y")
int x; // TODO: currently in "BSS", but supposed to be in "BSS2"? int x;
x = 0; x = 0;
if (memcmp(str, "aBC", 3)) if (memcmp(str, "aBC", 3))