Skip to content

Commit cab5b75

Browse files
author
H. Peter Anvin
committed
output: when converting OUT_SEGMENT to legacy, don't lose the addend
When converting an OUT_SEGMENT relocation to legacy, the addend is still significant, as it would represent an explicit addend to the segment number. Fixes: https://bugzilla.nasm.us/show_bug.cgi?id=3392783 Reported-by: David Fifield <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]>
1 parent c8af731 commit cab5b75

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

output/legacy.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* ----------------------------------------------------------------------- *
22
*
3-
* Copyright 2016-2017 The NASM Authors - All Rights Reserved
3+
* Copyright 2016-2022 The NASM Authors - All Rights Reserved
44
* See the file AUTHORS included with the NASM distribution for
55
* the specific copyright holders.
66
*
@@ -89,10 +89,8 @@ void nasm_do_legacy_output(const struct out_data *data)
8989

9090
case OUT_SEGMENT:
9191
type = OUT_ADDRESS;
92-
dptr = zero_buffer;
93-
size = (data->flags & OUT_SIGNED) ? -data->size : data->size;
9492
tsegment |= 1;
95-
break;
93+
/* fall through */
9694

9795
case OUT_ADDRESS:
9896
dptr = &data->toffset;

0 commit comments

Comments
 (0)