Skip to content

Commit

Permalink
Don't export anonymous labels (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 authored Oct 31, 2023
1 parent a5d51b4 commit 32bc68d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/asm/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static char savedTIME[256];
static char savedDATE[256];
static char savedTIMESTAMP_ISO8601_LOCAL[256];
static char savedTIMESTAMP_ISO8601_UTC[256];
static bool exportall;
static bool exportAll;

bool sym_IsPC(struct Symbol const *sym)
{
Expand Down Expand Up @@ -513,7 +513,8 @@ static struct Symbol *addLabel(char const *symName)
// If the symbol already exists as a ref, just "take over" it
sym->type = SYM_LABEL;
sym->value = sect_GetSymbolOffset();
if (exportall)
// Don't export anonymous labels
if (exportAll && symName[0] != '!')
sym->isExported = true;
sym->section = sect_GetSymbolSection();

Expand Down Expand Up @@ -668,7 +669,7 @@ struct Symbol *sym_Ref(char const *symName)
// Set whether to export all relocatable symbols by default
void sym_SetExportAll(bool set)
{
exportall = set;
exportAll = set;
}

static struct Symbol *createBuiltinSymbol(char const *symName)
Expand Down

0 comments on commit 32bc68d

Please sign in to comment.