gas fx_pcrel_adjust
Alan Modra
amodra@gmail.com
Mon Nov 5 07:09:00 GMT 2012
m68k really wants a signed fx_pcrel_adjust, so make it so. The other
targets that touch fx_pcrel_adjust, m68hc11 and xgate, only write to
the field. Maintainers please investigate.
* 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.
Index: gas/write.h
===================================================================
RCS file: /cvs/src/src/gas/write.h,v
retrieving revision 1.21
diff -u -p -r1.21 write.h
--- gas/write.h 23 Jan 2010 12:05:32 -0000 1.21
+++ gas/write.h 5 Nov 2012 06:53:10 -0000
@@ -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;
Index: gas/config/tc-m68k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.c,v
retrieving revision 1.116
diff -u -p -r1.116 tc-m68k.c
--- gas/config/tc-m68k.c 16 May 2012 10:26:47 -0000 1.116
+++ gas/config/tc-m68k.c 5 Nov 2012 00:39:15 -0000
@@ -1377,9 +1377,7 @@ tc_gen_reloc (asection *section ATTRIBUT
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;
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list