This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] (re)Fix v850 lo() and hi() handling
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 18 May 2005 10:42:18 +0100
- Subject: [PATCH] (re)Fix v850 lo() and hi() handling
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);
}