diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2016-02-12 13:46:39 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2016-02-12 13:49:45 -0800 |
commit | ca351fa1756a47d70b9fa7db6fe6ad8c9ab0d8c6 (patch) | |
tree | 435e71d9f28080d12f945b4e8afd9977b34860b8 | |
parent | fc1a7ad66296e13652ea6faca009bbd9ce5c26f6 (diff) | |
download | nasm-ca351fa1756a47d70b9fa7db6fe6ad8c9ab0d8c6.tar.gz |
assemble.c: when converting an address to RAWDATA, need to update size
When converting an address to RAWDATA we have to copy the address size
into the size variable, as the size variable may be negative.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | assemble.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -357,7 +357,7 @@ static void out(int64_t offset, int32_t segto, const void *data, WRITEADDR(q, *(int64_t *)data, asize); data = p; type = OUT_RAWDATA; - + size = asize; asize = 0; /* No longer an address */ } @@ -380,12 +380,13 @@ static void out(int64_t offset, int32_t segto, const void *data, errfunc(ERR_NONFATAL, "%d-bit signed relocation unsupported by output format %s\n", asize << 3, outfmt->shortname); + size = asize; } else { errfunc(ERR_WARNING | ERR_WARN_ZEXTRELOC, "%d-bit unsigned relocation zero-extended from %d bits\n", asize << 3, outfmt->maxbits); outfmt->output(segto, data, type, amax, segment, wrt); - size -= amax; + size = asize - amax; } data = zero_buffer; type = OUT_RAWDATA; |