Example #1
0
fixS *
gas_cgen_record_fixup (fragS *frag, int where, const CGEN_INSN *insn,
		       int length, const CGEN_OPERAND *operand, int opinfo,
		       symbolS *symbol, offsetT offset)
{
  fixS *fixP;

  /* It may seem strange to use operand->attrs and not insn->attrs here,
     but it is the operand that has a pc relative relocation.  */
  fixP = fix_new (frag, where, length / 8, symbol, offset,
		  CGEN_OPERAND_ATTR_VALUE (operand, CGEN_OPERAND_PCREL_ADDR),
		  (bfd_reloc_code_real_type)
		    ((int) BFD_RELOC_UNUSED
		     + (int) operand->type));
  fixP->fx_cgen.insn = insn;
  fixP->fx_cgen.opinfo = opinfo;
  fixP->fx_cgen.field = NULL;
  fixP->fx_cgen.msb_field_p = 0;

  return fixP;
}
Example #2
0
void
md_assemble(
char *str)
{

	assert(str);
	pa_ip(str);
	if (!found_jbsr)
		toP = frag_more(4);
	else
		found_jbsr = 0;

#ifdef NeXT_MOD	/* mark sections containing instructions */
    /*
     * We are putting a machine instruction in this section so mark it as
     * containg some machine instructions.
     */
    frchain_now->frch_section.flags |= S_ATTR_SOME_INSTRUCTIONS;
#endif /* NeXT_MOD */

    /* put out the opcode */
    md_number_to_chars(toP, the_insn.opcode, 4);

    /* put out the symbol-dependent stuff */
    if (the_insn.reloc != NO_RELOC) {
	    fix_new(frag_now,			  /* which frag */
		    (toP - frag_now->fr_literal), /* where */
		    4,				  /* size */
		    the_insn.exp.X_add_symbol,
		    the_insn.exp.X_subtract_symbol,
		    the_insn.exp.X_add_number,	  /* offset */
		    the_insn.pcrel,
		    the_insn.pcrel_reloc,
		    the_insn.reloc);
    }
}