summaryrefslogtreecommitdiff
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
commitb6e5970fb6dfd15565d110bb34cd0a265a839da8 (patch)
treee4be69655704adf8c8e0ac40ab0a62b8e5604d2a /gas/config/tc-sparc.c
parentda282ef92b27ebe7804b47ab953e1fcc387c51a5 (diff)
downloadbinutils-redhat-b6e5970fb6dfd15565d110bb34cd0a265a839da8.tar.gz
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 c98081c959..84472b3cbd 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. */