diff options
author | Andy Polyakov <appro@users.sourceforge.net> | 2008-05-27 14:01:25 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-27 14:01:25 -0700 |
commit | 082dbb471fdc6381965c6813a35fbff4a88b5020 (patch) | |
tree | 2b48c00af506dcca3efa9b460a4900ef26a4a0d4 /output/outcoff.c | |
parent | f9ca812cf8af831fd77bb0129827de145f11eca2 (diff) | |
download | nasm-082dbb471fdc6381965c6813a35fbff4a88b5020.tar.gz nasm-082dbb471fdc6381965c6813a35fbff4a88b5020.tar.bz2 nasm-082dbb471fdc6381965c6813a35fbff4a88b5020.zip |
outcoff.c: remove dead code, add check for imagerel
Remove commented-out (dead) code, add check that the imagerel
references are valid.
Diffstat (limited to 'output/outcoff.c')
-rw-r--r-- | output/outcoff.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/output/outcoff.c b/output/outcoff.c index ae880cb..4655e21 100644 --- a/output/outcoff.c +++ b/output/outcoff.c @@ -566,16 +566,10 @@ static void coff_out(int32_t segto, const void *data, int32_t fix = 0; p = mydata; if (size == 8) { -/* if (segment != NO_SEG || wrt != NO_SEG) { - if (wrt != NO_SEG) { - error(ERR_NONFATAL, "COFF format does not support" - " WRT types"); - } else if (segment % 2) { - error(ERR_NONFATAL, "COFF format does not support" - " segment base references"); - } else - fix = coff_add_reloc(s, segment, false); - } */ + if (wrt == imagebase_sect) { + error(ERR_NONFATAL, "operand size mismatch: 'wrt " + WRT_IMAGEBASE "' is a 32-bit operand"); + } fix = coff_add_reloc(s, segment, IMAGE_REL_AMD64_ADDR64); WRITEDLONG(p, *(int64_t *)data + fix); coff_sect_write(s, mydata, size); |