Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions output/outobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,9 @@ static int32_t obj_segment(char *name, int *bits)
}
}

if (!seg->use32 && seg->grp && !strcmp(seg->grp->name, "FLAT"))
nasm_panic("wrong combination of USE16(16-bit segment) and FLAT");

/* We need to know whenever we have at least one 32-bit segment */
obj_use32 |= seg->use32;

Expand All @@ -1536,7 +1539,12 @@ static int32_t obj_segment(char *name, int *bits)
nasm_free(grp->segs[i].name);
grp->segs[i] = grp->segs[grp->nindices];
grp->segs[grp->nindices++].index = seg->obj_index;
if (seg->grp)
/*
* The group FLAT is a pseudo group. Therefore, it is
* allowed to redefine a segment in the group FLAT as
* other group.
*/
if (seg->grp && strcmp(seg->grp->name, "FLAT"))
nasm_warn(WARN_OTHER, "segment `%s' is already part of"
" a group: first one takes precedence",
seg->name);
Expand Down Expand Up @@ -1651,7 +1659,12 @@ obj_directive(enum directive directive, char *value)
*/
grp->segs[grp->nentries++] = grp->segs[grp->nindices];
grp->segs[grp->nindices++].index = seg->obj_index;
if (seg->grp)
/*
* The group FLAT is a pseudo group. Therefore, it is
* allowed to redefine a segment in the group FLAT as
* other group.
*/
if (seg->grp && strcmp(seg->grp->name, "FLAT"))
nasm_warn(WARN_OTHER, "segment `%s' is already part of"
" a group: first one takes precedence",
seg->name);
Expand Down