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>
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 <david@bamsoftware.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed and unsigned are really two flags; might as well allow this
field to contain additional flags.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Make the internal handling of segment numbers just a little more
sane. The whole use of when we have done ofmt->segbase or not is
crazy, though...
In the meantime, add a few more hacks to the dbg output format to make
it more useful.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
The legacy output doesn't distinguish between segments and other
addresses, so we need to force the offset to zero before passing it
down to the output layer.
This addresses BR 3392406.
Reported-by: <rugxulo@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
For expressions like [foo - $] or [bar - $$] our relocation base is
not the same as the end of the instruction. Make that explicit.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>