aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1992-09-14 05:25:56 +0000
committerIan Lance Taylor <ian@airs.com>1992-09-14 05:25:56 +0000
commite41474b77db9e86cbc8b4e2860b74fa8b647cffc (patch)
tree62866b29ec893766dc9c680be5f084027a6319d5
parentca5e9d49dd1f1ccb8bb6320dc910f24a8457c90f (diff)
downloadgdb-e41474b77db9e86cbc8b4e2860b74fa8b647cffc.zip
gdb-e41474b77db9e86cbc8b4e2860b74fa8b647cffc.tar.gz
gdb-e41474b77db9e86cbc8b4e2860b74fa8b647cffc.tar.bz2
Sun Sep 13 20:29:39 1992 Ian Lance Taylor (ian@cygnus.com)
* obj-coffbfd.h: define WARN_SIGNED_OVERFLOW_WORD. obj-coffbfd.c (fixup_segment): check for signed .word overflow if WARN_SIGNED_OVERFLOW_WORD.
-rw-r--r--gas/config/ChangeLog4
-rw-r--r--gas/config/obj-coffbfd.c11
-rw-r--r--gas/config/obj-coffbfd.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/gas/config/ChangeLog b/gas/config/ChangeLog
index f8adc0f..4b3bef2 100644
--- a/gas/config/ChangeLog
+++ b/gas/config/ChangeLog
@@ -1,5 +1,9 @@
Sun Sep 13 20:29:39 1992 Ian Lance Taylor (ian@cygnus.com)
+ * obj-coffbfd.h: define WARN_SIGNED_OVERFLOW_WORD.
+ obj-coffbfd.c (fixup_segment): check for signed .word overflow if
+ WARN_SIGNED_OVERFLOW_WORD.
+
* obj-coffbfd.c (fixup_segment): fixed missing parens in
expression checking for byte or word overflow.
diff --git a/gas/config/obj-coffbfd.c b/gas/config/obj-coffbfd.c
index 1f59b55..b66269c 100644
--- a/gas/config/obj-coffbfd.c
+++ b/gas/config/obj-coffbfd.c
@@ -2262,6 +2262,17 @@ segT this_segment_type)
as_bad("Value of %d too large for field of %d bytes at 0x%x",
add_number, size, fragP->fr_address + where);
} /* generic error checking */
+#ifdef WARN_SIGNED_OVERFLOW_WORD
+ /* Warn if a .word value is too large when treated as
+ a signed number. We already know it is not too
+ negative. This is to catch over-large switches
+ generated by gcc on the 68k. */
+ if (! flagseen['J']
+ && size == 2
+ && add_number > 0x7fff)
+ as_bad ("Signed .word overflow; switch may be too large; %d at 0x%x",
+ add_number, fragP->fr_address + where);
+#endif
} /* not a bit fix */
/* once this fix has been applied, we don't have to output anything
nothing more need be done -*/
diff --git a/gas/config/obj-coffbfd.h b/gas/config/obj-coffbfd.h
index 217fd86..ad8b5d4 100644
--- a/gas/config/obj-coffbfd.h
+++ b/gas/config/obj-coffbfd.h
@@ -23,6 +23,7 @@
#define OBJ_COFF 1
#define WORKING_DOT_WORD
+#define WARN_SIGNED_OVERFLOW_WORD
#include "targ-cpu.h"