summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2015-02-15 18:18:27 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2015-02-15 18:18:57 +0300
commitd72bec12bc0f9dbc1aceedb6c831d32b6e47ece1 (patch)
tree16f7f4a5ce0561b1a630e8e08c5ad0f9099f54f9
parent6d42e9ba4730dc8472e4ec698e2af549c53861c3 (diff)
downloadnasm-d72bec12bc0f9dbc1aceedb6c831d32b6e47ece1.tar.gz
output: bin -- Fix section length miscalc for OUT_ADDRESS
While we using proper @asize variable for relocation itself we miss the fact that @size variable (which might be negative for signed relocations since fd52c277dd6) is used to calculate section size increment. http://bugzilla.nasm.us/show_bug.cgi?id=3392299 Reported-by: Ben de Waal <ben@dewaals.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--output/outbin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/output/outbin.c b/output/outbin.c
index 01eae1cf..76a00a82 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -781,6 +781,12 @@ static void bin_out(int32_t segto, const void *data,
WRITEADDR(p, *(int64_t *)data, asize);
saa_wbytes(s->contents, mydata, asize);
}
+
+ /*
+ * Reassign size with sign dropped, we will need it
+ * for section length calculation.
+ */
+ size = asize;
break;
}