diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-11-13 09:37:59 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-11-13 09:37:59 -0800 |
commit | d1fb15c154b99f9ca8d2356fa9057827b0ab89af (patch) | |
tree | e6e95a1979107466eadfad29577e278ee1273890 /output/outcoff.c | |
parent | a5fb90834aa2e849e67bf45b478d498a6cb72062 (diff) | |
download | nasm-d1fb15c154b99f9ca8d2356fa9057827b0ab89af.tar.gz nasm-d1fb15c154b99f9ca8d2356fa9057827b0ab89af.tar.bz2 nasm-d1fb15c154b99f9ca8d2356fa9057827b0ab89af.zip |
Address data is int64_t; simplify writing an address object
Address data is always int64_t even if the size itself is smaller;
this was broken on bigendian hosts (still need testing!)
Create simple "write sized object" macros.
Diffstat (limited to 'output/outcoff.c')
-rw-r--r-- | output/outcoff.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/output/outcoff.c b/output/outcoff.c index 95a1603..9be558b 100644 --- a/output/outcoff.c +++ b/output/outcoff.c @@ -533,7 +533,7 @@ static void coff_out(int32_t segto, const void *data, fix = coff_add_reloc(s, segment, false, false); } p = mydata; - WRITELONG(p, *(int32_t *)data + fix); + WRITELONG(p, *(int64_t *)data + fix); coff_sect_write(s, mydata, size); } } else { @@ -555,7 +555,7 @@ static void coff_out(int32_t segto, const void *data, coff_sect_write(s, mydata, size); } else { fix = coff_add_reloc(s, segment, false, false); - WRITELONG(p, *(int32_t *)data + fix); + WRITELONG(p, *(int64_t *)data + fix); coff_sect_write(s, mydata, size); } } @@ -577,9 +577,9 @@ static void coff_out(int32_t segto, const void *data, fix = coff_add_reloc(s, segment, true, false); p = mydata; if (win32 | win64) { - WRITELONG(p, *(int32_t *)data + 4 - size + fix); + WRITELONG(p, *(int64_t *)data + 4 - size + fix); } else { - WRITELONG(p, *(int32_t *)data - (size + s->len) + fix); + WRITELONG(p, *(int64_t *)data - (size + s->len) + fix); } coff_sect_write(s, mydata, 4L); } |