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>
This commit is contained in:
H. Peter Anvin 2016-02-11 21:13:54 -08:00
parent b64125022d
commit b03d91e6ab

View File

@ -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);