From 05343069faf5d3b8249b8300d73859643e057f37 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Fri, 29 Nov 2024 11:29:35 +0900 Subject: [PATCH] outobj: disallow the combination of USE16(16-bit segment) and FLAT FLAT should be used only with USE32(32-bit segment). Signed-off-by: KO Myung-Hun --- output/outobj.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/output/outobj.c b/output/outobj.c index ce108f15..5645928e 100644 --- a/output/outobj.c +++ b/output/outobj.c @@ -1492,6 +1492,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;