From ed859f72a120888868eb37beee0fcb2ab1710af5 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 15 Jun 2018 00:03:53 -0700 Subject: output: remove ABSOLUTE handling, OUT_RAWDATA asserts ABSOLUTE handling can be done centrally, and shouldn't need to be in every backend. Simply drop the call to ofmt->output(). Many backends have an assert for OUT_RAWDATA not having a target segment; this doesn't make any sense as output/legacy.c will not allow that to happen. Signed-off-by: H. Peter Anvin --- asm/assemble.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'asm') diff --git a/asm/assemble.c b/asm/assemble.c index a6bb0ee5..e71e907a 100644 --- a/asm/assemble.c +++ b/asm/assemble.c @@ -415,7 +415,18 @@ static void out(struct out_data *data) data->size = amax; } lfmt->output(data); - ofmt->output(data); + + if (likely(data->segment != NO_SEG)) { + ofmt->output(data); + } else { + /* Outputting to ABSOLUTE section - only reserve is permitted */ + if (data->type != OUT_RESERVE) { + nasm_error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]" + " space"); + } + /* No need to push to the backend */ + } + data->offset += data->size; data->insoffs += data->size; -- cgit v1.2.3