From 359b63f8976375f071edc33092daea57efa768fb Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 6 Nov 2010 02:45:45 +0300 Subject: 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 --- output/outcoff.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'output/outcoff.c') 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); -- cgit v1.2.3