This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Multi-arch bug in gas - tc_fix_adjustable


I have just added a tc_fix_adjustable function to the ip2k port and I think
there is a problem...

Cgen generated archs use a temporary number (BFD_RELOC_UNUSED +
operand->type) in fix->fx_r_type to describe the type, which then gets
converted into the propper BFD type by gas_cgen_md_apply_fix3.

The problem is that gas write.c calls the arch dependant tc_fix_adjustable
function before fix->fx_r_type, and most cgen based archs that I have
checked have an if or switch statement based on fix->fx_r_type that compares
it with BFD types.

For example:


arm_fix_adjustable (fixP)
   fixS * fixP;
  if (fixP->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE)
    return 1;
  return 0;

This compare will always fail as 'BFD_RELOC_UNUSED + operand->type' will
never match any BFD_RELOC define.

I check a few other cgen based ports and they all have this style of code.

To make the ip2k implementation work I am using fixP->fx_cgen.opinfo, not


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