Merge pull request #450 from ISSOtm/labels_in_sections

Prevent creating labels outside of sections
This commit is contained in:
Eldred Habert
2019-11-06 08:33:25 +01:00
committed by GitHub
8 changed files with 25 additions and 0 deletions

View File

@@ -634,6 +634,10 @@ void sym_AddReloc(char *tzSym)
nsym->pScope = scope;
nsym->pSection = pCurrentSection;
/* Labels need to be assigned a section, except PC */
if (!pCurrentSection && strcmp(tzSym, "@"))
yyerror("Label \"%s\" created outside of a SECTION",
tzSym);
updateSymbolFilename(nsym);
}