[PATCH] (re)Fix v850 lo() and hi() handling
Nick Clifton
nickc@redhat.com
Wed May 18 10:59:00 GMT 2005
Hi Guys,
My patch yesterday to fix the handling pf the lo() and hi() pseudo
reloc operators int he v850 assembler did not work correctly. In
particular it did not properly truncate values that were too large
for the field into which they were being inserted. This resulted in
the assembler being unable to assemble parts of the v850 gcc
toolchain.
I am therefore applying the patch below to fix this problem.
Cheers
Nick
gas/ChangeLog
2005-05-18 Nick Clifton <nickc@redhat.com>
* config/tc-v850.c (md_apply_fix3): Only use the insertion routine
if one exists. Ignore any error messages it may produce, just
allow it to perform the insertion.
Index: gas/config/tc-v850.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-v850.c,v
retrieving revision 1.46
diff -c -3 -p -r1.46 tc-v850.c
*** gas/config/tc-v850.c 17 May 2005 11:56:11 -0000 1.46
--- gas/config/tc-v850.c 18 May 2005 09:41:05 -0000
*************** md_apply_fix3 (fixS *fixP, valueT *value
*** 2321,2328 ****
/* We still have to insert the value into memory! */
where = fixP->fx_frag->fr_literal + fixP->fx_where;
! if (fixP->tc_fix_data != NULL)
{
struct v850_operand * operand = (struct v850_operand *) fixP->tc_fix_data;
unsigned long insn;
--- 2321,2330 ----
/* We still have to insert the value into memory! */
where = fixP->fx_frag->fr_literal + fixP->fx_where;
! if (fixP->tc_fix_data != NULL
! && ((struct v850_operand *) fixP->tc_fix_data)->insert != NULL)
{
+ const char * message = NULL;
struct v850_operand * operand = (struct v850_operand *) fixP->tc_fix_data;
unsigned long insn;
*************** md_apply_fix3 (fixS *fixP, valueT *value
*** 2339,2346 ****
/* Use the operand's insertion procedure, if present, in order to
make sure that the value is correctly stored in the insn. */
! insn = v850_insert_operand (insn, operand, (offsetT) value,
! fixP->fx_file, fixP->fx_line, NULL);
bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
}
--- 2341,2348 ----
/* Use the operand's insertion procedure, if present, in order to
make sure that the value is correctly stored in the insn. */
! insn = operand->insert (insn, (offsetT) value, message);
! /* Ignore message even if it is set. */
bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
}
More information about the Binutils
mailing list