aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sparc.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-05-29 13:18:59 +0000
committerJakub Jelinek <jakub@redhat.com>2007-05-29 13:18:59 +0000
commitc699f0877959d373f7c0fc03ce517ffba3cfac03 (patch)
tree939ec461b7207c90b55433bbead2dd5dcdfa9a69 /gas/config/tc-sparc.c
parent3ba20bde7e5976625515b62ba462f7bf2dbf8b23 (diff)
downloadgdb-c699f0877959d373f7c0fc03ce517ffba3cfac03.zip
gdb-c699f0877959d373f7c0fc03ce517ffba3cfac03.tar.gz
gdb-c699f0877959d373f7c0fc03ce517ffba3cfac03.tar.bz2
gas/
2007-05-29 David S. Miller <davem@davemloft.net> Jakub Jelinek <jakub@redhat.com> PR gas/4558 * config/tc-sparc.c (md_apply_fix): Fix relocation overflow checks for BFD_RELOC_SPARC_WDISP16 and BFD_RELOC_SPARC_WDISP19. gas/testsuite/ 2007-05-29 Jakub Jelinek <jakub@redhat.com> PR gas/4558 * gas/sparc/sparc.exp: Add v9branch{1,2,3,4,5} tests. * gas/sparc/v9branch1.d: New test. * gas/sparc/v9branch1.s: New. * gas/sparc/v9branch2.d: New test. * gas/sparc/v9branch2.s: New. * gas/sparc/v9branch3.d: New test. * gas/sparc/v9branch3.s: New. * gas/sparc/v9branch4.d: New test. * gas/sparc/v9branch4.s: New. * gas/sparc/v9branch5.d: New test. * gas/sparc/v9branch5.s: New.
Diffstat (limited to 'gas/config/tc-sparc.c')
-rw-r--r--gas/config/tc-sparc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index c98081c..84472b3 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -1,6 +1,6 @@
/* tc-sparc.c -- Assemble for the SPARC
Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -3309,9 +3309,9 @@ md_apply_fix (fixP, valP, segment)
break;
case BFD_RELOC_SPARC_WDISP16:
- /* FIXME: simplify. */
- if (((val > 0) && (val & ~0x3fffc))
- || ((val < 0) && (~(val - 1) & ~0x3fffc)))
+ if ((val & 3)
+ || val >= 0x1fffc
+ || val <= -(offsetT) 0x20008)
as_bad_where (fixP->fx_file, fixP->fx_line,
_("relocation overflow"));
/* FIXME: The +1 deserves a comment. */
@@ -3320,9 +3320,9 @@ md_apply_fix (fixP, valP, segment)
break;
case BFD_RELOC_SPARC_WDISP19:
- /* FIXME: simplify. */
- if (((val > 0) && (val & ~0x1ffffc))
- || ((val < 0) && (~(val - 1) & ~0x1ffffc)))
+ if ((val & 3)
+ || val >= 0xffffc
+ || val <= -(offsetT) 0x100008)
as_bad_where (fixP->fx_file, fixP->fx_line,
_("relocation overflow"));
/* FIXME: The +1 deserves a comment. */