Skip to content

Commit 3f37cac

Browse files
komhhpax
authored andcommitted
outobj: allow for segments in the group FLAT to belong to the other group
It's possible that segments belong to both the group FLAT and the other group because the group FLAT is a pseudo group. Signed-off-by: KO Myung-Hun <[email protected]>
1 parent d45ad2e commit 3f37cac

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

output/outobj.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,12 @@ static int32_t obj_segment(char *name, int *bits)
15181518
nasm_free(grp->segs[i].name);
15191519
grp->segs[i] = grp->segs[grp->nindices];
15201520
grp->segs[grp->nindices++].index = seg->obj_index;
1521-
if (seg->grp)
1521+
/*
1522+
* The group FLAT is a pseudo group. Therefore, it is
1523+
* allowed to redefine a segment in the group FLAT as
1524+
* other group.
1525+
*/
1526+
if (seg->grp && strcmp(seg->grp->name, "FLAT"))
15221527
nasm_warn(WARN_OTHER, "segment `%s' is already part of"
15231528
" a group: first one takes precedence",
15241529
seg->name);
@@ -1633,7 +1638,12 @@ obj_directive(enum directive directive, char *value)
16331638
*/
16341639
grp->segs[grp->nentries++] = grp->segs[grp->nindices];
16351640
grp->segs[grp->nindices++].index = seg->obj_index;
1636-
if (seg->grp)
1641+
/*
1642+
* The group FLAT is a pseudo group. Therefore, it is
1643+
* allowed to redefine a segment in the group FLAT as
1644+
* other group.
1645+
*/
1646+
if (seg->grp && strcmp(seg->grp->name, "FLAT"))
16371647
nasm_warn(WARN_OTHER, "segment `%s' is already part of"
16381648
" a group: first one takes precedence",
16391649
seg->name);

0 commit comments

Comments
 (0)