summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Polyakov <appro@users.sourceforge.net>2008-05-27 14:01:25 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-27 14:01:25 -0700
commit082dbb471fdc6381965c6813a35fbff4a88b5020 (patch)
tree2b48c00af506dcca3efa9b460a4900ef26a4a0d4
parentf9ca812cf8af831fd77bb0129827de145f11eca2 (diff)
downloadnasm-082dbb471fdc6381965c6813a35fbff4a88b5020.tar.gz
outcoff.c: remove dead code, add check for imagerel
Remove commented-out (dead) code, add check that the imagerel references are valid.
-rw-r--r--output/outcoff.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/output/outcoff.c b/output/outcoff.c
index ae880cb2..4655e21f 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);