Tue Aug 6 12:58:03 1996 Martin M. Hunt <hunt@pizza.cygnus.com>

* tc-d10v.c: Added code to support 32-bit fixups for stabs.
This commit is contained in:
Martin Hunt 1996-08-06 20:01:07 +00:00
parent 5d9a99a79b
commit e805bff71d

View file

@ -466,7 +466,7 @@ build_insn (opcode, opers, insn)
/* /*
printf("need a fixup: "); printf("need a fixup: ");
print_expr_1(stdout,&opers[i]); print_expr_1(stdout,&opers[i]);
printf("\n"); printf("\n");ddd
*/ */
if (fixups->fc >= MAX_INSN_FIXUPS) if (fixups->fc >= MAX_INSN_FIXUPS)
@ -524,7 +524,7 @@ write_long (opcode, insn, fx)
4, 4,
&(fx->fix[i].exp), &(fx->fix[i].exp),
1, 1,
fx->fix[i].reloc); fx->fix[i].reloc|2048);
} }
} }
fx->fc = 0; fx->fc = 0;
@ -575,7 +575,7 @@ write_1_short (opcode, insn, fx)
4, 4,
&(fx->fix[i].exp), &(fx->fix[i].exp),
1, 1,
fx->fix[i].reloc); fx->fix[i].reloc|2048);
} }
} }
fx->fc = 0; fx->fc = 0;
@ -687,7 +687,7 @@ for (j=0; j<2; j++)
4, 4,
&(fx->fix[i].exp), &(fx->fix[i].exp),
1, 1,
fx->fix[i].reloc); fx->fix[i].reloc|2048);
} }
} }
fx->fc = 0; fx->fc = 0;
@ -1060,9 +1060,12 @@ md_apply_fix3 (fixp, valuep, seg)
} }
} }
/* printf("md_apply_fix: value=0x%x type=%d\n", value, fixp->fx_r_type); */ /* printf("md_apply_fix: value=0x%x type=0x%x where=0x%x\n", value, fixp->fx_r_type,fixp->fx_where); */
op_type = fixp->fx_r_type; op_type = fixp->fx_r_type;
if (op_type & 2048)
{
op_type -= 2048;
if (op_type & 1024) if (op_type & 1024)
{ {
op_type -= 1024; op_type -= 1024;
@ -1071,6 +1074,7 @@ md_apply_fix3 (fixp, valuep, seg)
} }
else else
fixp->fx_r_type = get_reloc((struct d10v_operand *)&d10v_operands[op_type]); fixp->fx_r_type = get_reloc((struct d10v_operand *)&d10v_operands[op_type]);
}
/* Fetch the instruction, insert the fully resolved operand /* Fetch the instruction, insert the fully resolved operand
value, and stuff the instruction back again. */ value, and stuff the instruction back again. */
@ -1087,13 +1091,16 @@ md_apply_fix3 (fixp, valuep, seg)
if (!fixp->fx_pcrel) if (!fixp->fx_pcrel)
value -= fixp->fx_where; value -= fixp->fx_where;
value >>= 2; value >>= 2;
break;
case BFD_RELOC_32:
bfd_putb32 ((bfd_vma) value, (unsigned char *) where);
return 1;
default: default:
break; break;
} }
/* printf(" insn=%x value=%x where=%x pcrel=%x\n",insn,value,fixp->fx_where,fixp->fx_pcrel); */ /* printf(" insn=%x value=%x where=%x pcrel=%x\n",insn,value,fixp->fx_where,fixp->fx_pcrel); */
insn = d10v_insert_operand (insn, op_type, (offsetT)value, left); insn = d10v_insert_operand (insn, op_type, (offsetT)value, left);
/* printf(" new insn=%x\n",insn); */ /* printf(" new insn=%x\n",insn); */
bfd_putb32 ((bfd_vma) insn, (unsigned char *) where); bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);