This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Possible reloc patch (2/2)


Richard Sandiford writes:
 > Am I right in thinking this is a special requirement of the gas port for
 > cgen?  I've just double checked on the gas output for i386 and m68hc11
 > targets, and there the relocs point to the start of the address that needs
 > to be modified, rather than the start of the containing instruction.

For these two it's kinda cumbersome to have separate relocs for each
possible 32 bit operand.  The wonders of complex addressing modes.
I'd treat these as special cases that are justified.

 > Couldn't there at least be an option for gas/cgen.c to generate relocs
 > like this as well?  Maybe some macro?  E.g.

In general you don't to add conditional compilation if there's
another solution.   Except for that, I think the following is
reasonable.  I'm not opposed to the following, but if it works
without the ifdef, so much the better.

 > >  > --- 590,601 ----
 > >  >         reloc_type = md_cgen_lookup_reloc (insn, operand, fixP);
 > >  >         if (reloc_type != BFD_RELOC_NONE)
 > >  >   	{
 > #ifdef CGEN_OPERAND_RELOCS
 > >  > + 	  const CGEN_IFLD *field;
 > >  > +
 > >  > + 	  field = cgen_ifield_lookup_by_num (gas_cgen_cpu_desc,
 > >  > + 					     operand->ifield);
 > >  > + 	  fixP->fx_where += field->word_offset / 8;
 > >  > + 	  fixP->fx_size = field->length / 8;
 > #endif
 > >  >   	  fixP->fx_r_type = reloc_type;
 > >  >   	}
 > >  >         else

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]