diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-10-27 22:19:59 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-10-27 22:19:59 -0700 |
commit | 03c4f90afa42cc8a7ed842ff0fc9d3c18a06dd2d (patch) | |
tree | 28527b6cd2b5d7978018b2eedeb2547e7ec7019d /output/outaout.c | |
parent | 67c637236a18e7ae3f3086487a88274a89608d10 (diff) | |
download | nasm-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/outaout.c')
-rw-r--r-- | output/outaout.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/output/outaout.c b/output/outaout.c index 48a2cff..467b20e 100644 --- a/output/outaout.c +++ b/output/outaout.c @@ -21,6 +21,7 @@ #include "raa.h" #include "stdscan.h" #include "outform.h" +#include "outlib.h" #if defined OF_AOUT || defined OF_AOUTB @@ -603,11 +604,7 @@ static void aout_out(int32_t segto, const void *data, if (!s && type != OUT_RESERVE) { error(ERR_WARNING, "attempt to initialize memory in the" " BSS section: ignored"); - if (type == OUT_REL2ADR) - size = 2; - else if (type == OUT_REL4ADR) - size = 4; - sbss.len += size; + sbss.len += realsize(type, size); return; } |