Add support for consecutive labels; needed by the B compiler.

This commit is contained in:
David Given 2016-11-27 21:18:00 +01:00
parent b9665c7c99
commit fbd6e8f63d

View file

@ -12,15 +12,20 @@ static struct symbol* pending;
void data_label(const char* label)
{
if (pending)
fatal("two consecutive data labels ('%s' and '%s')",
pending->name, label);
struct symbol* sym = symbol_get(label);
if (sym->is_defined)
fatal("label '%s' defined twice", sym->name);
if (pending)
fprintf(outputfile, "%s = %s\n",
platform_label(label), platform_label(pending->name));
else
{
pending = sym;
pending = symbol_get(label);
if (pending->is_defined)
fatal("label '%s' defined twice", pending->name);
pending->is_defined = true;
}
}
static const char* section_to_str(int section)
{