summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-02-11 21:13:54 -0800
committerH. Peter Anvin <hpa@zytor.com>2016-02-11 21:13:54 -0800
commitb03d91e6ab7686f5dee77c1e550fda9fd7abbb68 (patch)
tree1230970a6f1aaaad0da18a022ea78c0bca86ef84
parentb64125022d9743df8428d2fa925b36632b8ffc2a (diff)
downloadnasm-b03d91e6ab7686f5dee77c1e550fda9fd7abbb68.tar.gz
assemble.c: fix the handling of zero-extending unsigned relocations
First of all we printed the wrong error message, and second of all we need to set the segments to NO_SEG before passing them to the output format generator. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--assemble.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/assemble.c b/assemble.c
index b1e68217..acaf24bf 100644
--- a/assemble.c
+++ b/assemble.c
@@ -383,12 +383,13 @@ static void out(int64_t offset, int32_t segto, const void *data,
} else {
errfunc(ERR_WARNING | ERR_WARN_ZEXTRELOC,
"%d-bit unsigned relocation zero-extended from %d bits\n",
- asize << 4, outfmt->maxbits);
+ asize << 3, outfmt->maxbits);
outfmt->output(segto, data, type, amax, segment, wrt);
size -= amax;
}
data = zero_buffer;
type = OUT_RAWDATA;
+ segment = wrt = NO_SEG;
}
outfmt->output(segto, data, type, size, segment, wrt);