summaryrefslogtreecommitdiff
path: root/output/outcoff.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-27 22:19:59 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-27 22:19:59 -0700
commit03c4f90afa42cc8a7ed842ff0fc9d3c18a06dd2d (patch)
tree28527b6cd2b5d7978018b2eedeb2547e7ec7019d /output/outcoff.c
parent67c637236a18e7ae3f3086487a88274a89608d10 (diff)
downloadnasm-03c4f90afa42cc8a7ed842ff0fc9d3c18a06dd2d.tar.gz
nasm-03c4f90afa42cc8a7ed842ff0fc9d3c18a06dd2d.tar.bz2
nasm-03c4f90afa42cc8a7ed842ff0fc9d3c18a06dd2d.zip
output: add common file outlib.c for common functions; realsize()
Add a common file, outlib.c, for output formats. Add the function realsize() instead of open-coded variants in almost every backend. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'output/outcoff.c')
-rw-r--r--output/outcoff.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/output/outcoff.c b/output/outcoff.c
index 31e5cbe..16d2719 100644
--- a/output/outcoff.c
+++ b/output/outcoff.c
@@ -21,6 +21,7 @@
#include "saa.h"
#include "raa.h"
#include "outform.h"
+#include "outlib.h"
#if defined(OF_COFF) || defined(OF_WIN32) || defined(OF_WIN64)
@@ -527,11 +528,7 @@ static void coff_out(int32_t segto, const void *data,
if (!s->data && type != OUT_RESERVE) {
error(ERR_WARNING, "attempt to initialize memory in"
" BSS section `%s': ignored", s->name);
- if (type == OUT_REL2ADR)
- size = 2;
- else if (type == OUT_REL4ADR)
- size = 4;
- s->len += size;
+ s->len += realsize(type, size);
return;
}