mirror of
https://github.com/open-simh/simtools.git
synced 2026-02-05 07:55:45 +00:00
Better error message for .globl 1$
Local labels can't be exported (or imported).
This commit is contained in:
@@ -1131,16 +1131,22 @@ static int assemble(
|
||||
case P_GLOBL:
|
||||
{
|
||||
SYMBOL *sym;
|
||||
int islocal = 0;
|
||||
|
||||
while (!EOL(*cp)) {
|
||||
/* Loop and make definitions for
|
||||
comma-separated symbols */
|
||||
label = get_symbol(cp, &ncp, NULL);
|
||||
label = get_symbol(cp, &ncp, &islocal);
|
||||
if (label == NULL) {
|
||||
report(stack->top, "Illegal .GLOBL/.WEAK syntax\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (islocal) {
|
||||
report(stack->top, "Local label used in .GLOBL/.WEAK\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
sym = lookup_sym(label, &symbol_st);
|
||||
if (sym) {
|
||||
sym->flags |= SYMBOLFLAG_GLOBAL | (op->value == P_WEAK ? SYMBOLFLAG_WEAK : 0);
|
||||
|
||||
Reference in New Issue
Block a user