diff options
author | K. Richard Pixley <rich@cygnus> | 1991-08-15 20:34:42 +0000 |
---|---|---|
committer | K. Richard Pixley <rich@cygnus> | 1991-08-15 20:34:42 +0000 |
commit | 60b6e7da1f8e434af20a4bb1a29985faec04f850 (patch) | |
tree | 0cf65aebe57cef527b6616a0e9a30d4343771256 /gas | |
parent | ac1ac0cd4fd3b53a96d3ee040e601de748b92ebd (diff) | |
download | gdb-60b6e7da1f8e434af20a4bb1a29985faec04f850.zip gdb-60b6e7da1f8e434af20a4bb1a29985faec04f850.tar.gz gdb-60b6e7da1f8e434af20a4bb1a29985faec04f850.tar.bz2 |
Corrected relocation overflow checks.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-sparc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index c23138e..7593513 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1299,7 +1299,7 @@ long val; #ifndef NO_V9 case RELOC_11: if (((val > 0) && (val & ~0x7ff)) - || ((val < 0) && (~val & ~0x7ff))) { + || ((val < 0) && (~(val - 1) & ~0x7ff))) { as_bad("relocation overflow."); } /* on overflow */ @@ -1309,7 +1309,7 @@ long val; case RELOC_WDISP2_14: if (((val > 0) && (val & ~0x3fffc)) - || ((val < 0) && (~val & ~0x3fffc))) { + || ((val < 0) && (~(val - 1) & ~0x3fffc))) { as_bad("relocation overflow."); } /* on overflow */ @@ -1321,7 +1321,7 @@ long val; case RELOC_WDISP19: if (((val > 0) && (val & ~0x1ffffc)) - || ((val < 0) && (~val & ~0x1ffffc))) { + || ((val < 0) && (~(val - 1) & ~0x1ffffc))) { as_bad("relocation overflow."); } /* on overflow */ |