mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-21 03:14:19 +08:00
output/legacy: when converting OUT_SEGMENT, clear the offset
Legacy backends like obj/omf may depend on the offset being zero if not in use. Reported-by: Bernd Boeckmann <bernd-freedos@boeckmann.io> Reported-by: Vladimir Chebotarev <vladimir.chebotarev@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
7d5e549d63
commit
21c977e717
@ -1,6 +1,6 @@
|
||||
/* ----------------------------------------------------------------------- *
|
||||
*
|
||||
* Copyright 2016-2022 The NASM Authors - All Rights Reserved
|
||||
* Copyright 2016-2023 The NASM Authors - All Rights Reserved
|
||||
* See the file AUTHORS included with the NASM distribution for
|
||||
* the specific copyright holders.
|
||||
*
|
||||
@ -89,8 +89,11 @@ void nasm_do_legacy_output(const struct out_data *data)
|
||||
|
||||
case OUT_SEGMENT:
|
||||
type = OUT_ADDRESS;
|
||||
if (tsegment != NO_SEG && tsegment < SEG_ABS)
|
||||
tsegment |= 1;
|
||||
/* fall through */
|
||||
dptr = zero_buffer;
|
||||
size = data->size;
|
||||
break;
|
||||
|
||||
case OUT_ADDRESS:
|
||||
dptr = &data->toffset;
|
||||
|
Loading…
Reference in New Issue
Block a user