diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-11-06 02:45:45 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-11-06 02:45:45 +0300 |
commit | 359b63f8976375f071edc33092daea57efa768fb (patch) | |
tree | 2e1456c2c4c335295454ad76b755066e8b30a8c8 /output/outcoff.c | |
parent | 0d485cbdd68a68c08400cbec7666a5f6db73086b (diff) | |
download | nasm-359b63f8976375f071edc33092daea57efa768fb.tar.gz nasm-359b63f8976375f071edc33092daea57efa768fb.tar.bz2 nasm-359b63f8976375f071edc33092daea57efa768fb.zip |
coff: Issue fatal signal on relocations more then 0xffff
Actually it's temporary action. We have to support more
relocations then that but it requires some more code rework.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output/outcoff.c')
-rw-r--r-- | output/outcoff.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/output/outcoff.c b/output/outcoff.c index 5b232bb..a089b20 100644 --- a/output/outcoff.c +++ b/output/outcoff.c @@ -939,6 +939,10 @@ static void coff_section_header(char *name, int32_t vsize, fwriteint32_t(datapos, ofile); fwriteint32_t(relpos, ofile); fwriteint32_t(0L, ofile); /* no line numbers - we don't do 'em */ + + if (nrelocs >= IMAGE_SCN_MAX_RELOC) + nasm_error(ERR_FATAL, "Too many relocations (%d)\n", nrelocs); + fwriteint16_t(nrelocs, ofile); fwriteint16_t(0, ofile); /* again, no line numbers */ fwriteint32_t(flags, ofile); |