aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sh.c
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@rr.iij4u.or.jp>2009-08-29 10:38:33 +0000
committerKaz Kojima <kkojima@rr.iij4u.or.jp>2009-08-29 10:38:33 +0000
commit0c9b4fd74a7325e8afd54cbc42d5fad5dd3e4655 (patch)
treee81ceb21c164f3493934c14ccd68ee2550079a44 /gas/config/tc-sh.c
parent77d7dc9283af8e77f27314c9e2e79fbdea9ce7ff (diff)
downloadfsf-binutils-gdb-0c9b4fd74a7325e8afd54cbc42d5fad5dd3e4655.zip
fsf-binutils-gdb-0c9b4fd74a7325e8afd54cbc42d5fad5dd3e4655.tar.gz
fsf-binutils-gdb-0c9b4fd74a7325e8afd54cbc42d5fad5dd3e4655.tar.bz2
* config/tc-sh.c (md_apply_fix): Extend sign of the offset value
for 64-bit host. * gas/sh/sign-extension.d: New file. * gas/sh/sign-extension.s: New file. * gas/sh/basic.exp: Run new test.
Diffstat (limited to 'gas/config/tc-sh.c')
-rw-r--r--gas/config/tc-sh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 24a2954..4bc5ee6 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -1,6 +1,6 @@
/* tc-sh.c -- Assemble code for the Renesas / SuperH SH
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -4183,6 +4183,9 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
val = ((val >> shift)
| ((long) -1 & ~ ((long) -1 >> shift)));
}
+
+ /* Extend sign for 64-bit host. */
+ val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
if (max != 0 && (val < min || val > max))
as_bad_where (fixP->fx_file, fixP->fx_line, _("offset out of range"));
else if (max != 0)