mirror of
https://github.com/open-simh/simtools.git
synced 2026-02-24 16:08:50 +00:00
Fix references to blank section
Its name is empty, not ". BLK."
This commit is contained in:
41
assemble.c
41
assemble.c
@@ -1059,34 +1059,29 @@ do_mcalled_macro:
|
|||||||
SYMBOL *sectsym;
|
SYMBOL *sectsym;
|
||||||
SECTION *sect;
|
SECTION *sect;
|
||||||
unsigned int old_flags = ~0u;
|
unsigned int old_flags = ~0u;
|
||||||
int unnamed_csect = 0;
|
|
||||||
|
|
||||||
label = get_symbol(cp, &cp, NULL);
|
label = get_symbol(cp, &cp, NULL);
|
||||||
if (label == NULL) {
|
if (label == NULL) {
|
||||||
label = memcheck(strdup(". BLK."));
|
sect = &blank_section;
|
||||||
unnamed_csect = 1;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
sectsym = lookup_sym(label, §ion_st);
|
||||||
|
if (sectsym) {
|
||||||
|
sect = sectsym->section;
|
||||||
|
free(label);
|
||||||
|
old_flags = sect->flags;
|
||||||
|
} else {
|
||||||
|
sect = new_section();
|
||||||
|
sect->label = label;
|
||||||
|
sect->flags = 0;
|
||||||
|
sect->pc = 0;
|
||||||
|
sect->size = 0;
|
||||||
|
sect->type = SECTION_USER;
|
||||||
|
sections[sector++] = sect;
|
||||||
|
sectsym = add_sym(label, 0, SYMBOLFLAG_DEFINITION, sect, §ion_st);
|
||||||
|
|
||||||
sectsym = lookup_sym(label, §ion_st);
|
/* page 6-41 table 6-5 */
|
||||||
if (sectsym) {
|
if (op->value == P_PSECT) {
|
||||||
sect = sectsym->section;
|
|
||||||
free(label);
|
|
||||||
old_flags = sect->flags;
|
|
||||||
} else {
|
|
||||||
sect = new_section();
|
|
||||||
sect->label = label;
|
|
||||||
sect->flags = 0;
|
|
||||||
sect->pc = 0;
|
|
||||||
sect->size = 0;
|
|
||||||
sect->type = SECTION_USER;
|
|
||||||
sections[sector++] = sect;
|
|
||||||
sectsym = add_sym(label, 0, SYMBOLFLAG_DEFINITION, sect, §ion_st);
|
|
||||||
|
|
||||||
/* page 6-41 table 6-5 */
|
|
||||||
if (op->value == P_PSECT) {
|
|
||||||
sect->flags |= PSECT_REL;
|
|
||||||
} else if (op->value == P_CSECT) {
|
|
||||||
if (unnamed_csect) {
|
|
||||||
sect->flags |= PSECT_REL;
|
sect->flags |= PSECT_REL;
|
||||||
} else {
|
} else {
|
||||||
sect->flags |= PSECT_REL | PSECT_COM | PSECT_GBL;
|
sect->flags |= PSECT_REL | PSECT_COM | PSECT_GBL;
|
||||||
|
|||||||
Reference in New Issue
Block a user