aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-11-05 07:10:36 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-11-05 07:10:36 +0000
commita123fcc4dc331ca444ed97dc8100acd18525efee (patch)
treebb6a7a4c1a300e12a139718622cd183984534e3e
parent513ccc16f988a3387e3cc77de1ca93041e3c7b13 (diff)
downloadbinutils-a123fcc4dc331ca444ed97dc8100acd18525efee.tar.gz
* write.h (struct fix <fx_pcrel_adjust>): Make it a signed char.
* config/tc-m68k.c (tc_gen_reloc, md_pcrel_from): Remove explicit sign extendion of fx_pxrel_adjust.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-m68k.c8
-rw-r--r--gas/write.h4
3 files changed, 10 insertions, 8 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ed0f29769..082dfd601 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-05 Alan Modra <amodra@gmail.com>
+
+ * write.h (struct fix <fx_pcrel_adjust>): Make it a signed char.
+ * config/tc-m68k.c (tc_gen_reloc, md_pcrel_from): Remove explicit
+ sign extendion of fx_pxrel_adjust.
+
2012-11-01 Maciej W. Rozycki <macro@codesourcery.com>
* config/tc-mips.c (is_delay_slot_valid): Simplify expression.
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 21accf605..ea47ba402 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -1377,9 +1377,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
reloc->addend = fixp->fx_addnumber;
else
reloc->addend = (section->vma
- /* Explicit sign extension in case char is
- unsigned. */
- + ((fixp->fx_pcrel_adjust & 0xff) ^ 0x80) - 0x80
+ + fixp->fx_pcrel_adjust
+ fixp->fx_addnumber
+ md_pcrel_from (fixp));
#endif
@@ -7911,9 +7909,7 @@ md_pcrel_from (fixS *fixP)
{
int adjust;
- /* Because fx_pcrel_adjust is a char, and may be unsigned, we explicitly
- sign extend the value here. */
- adjust = ((fixP->fx_pcrel_adjust & 0xff) ^ 0x80) - 0x80;
+ adjust = fixP->fx_pcrel_adjust;
if (adjust == 64)
adjust = -1;
return fixP->fx_where + fixP->fx_frag->fr_address - adjust;
diff --git a/gas/write.h b/gas/write.h
index 8303f1be9..d7215816d 100644
--- a/gas/write.h
+++ b/gas/write.h
@@ -64,8 +64,8 @@ struct fix
/* The value is signed when checking for overflow. */
unsigned fx_signed : 1;
- /* pc-relative offset adjust (only used by m68k and m68hc11) */
- char fx_pcrel_adjust;
+ /* pc-relative offset adjust (only used by some CPU specific code) */
+ signed char fx_pcrel_adjust;
/* How many bytes are involved? */
unsigned char fx_size;