diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2018-06-15 00:03:53 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2018-06-15 00:03:53 -0700 |
commit | ed859f72a120888868eb37beee0fcb2ab1710af5 (patch) | |
tree | bf426751c5ecea02fb29a42cb1f038a05ee0e4ca /asm | |
parent | 0125c446ddba6ce02cc5654bdcfcfa41e46b8223 (diff) | |
download | nasm-ed859f72a120888868eb37beee0fcb2ab1710af5.tar.gz |
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 <hpa@linux.intel.com>
Diffstat (limited to 'asm')
-rw-r--r-- | asm/assemble.c | 13 |
1 files changed, 12 insertions, 1 deletions
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; |