This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Multi-arch bug in gas - tc_fix_adjustable
- From: "Nick Kelsey" <nickk at ubicom dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Tue, 17 Dec 2002 14:46:14 -0800
- Subject: Multi-arch bug in gas - tc_fix_adjustable
- Reply-to: "Nick Kelsey" <nickk at ubicom dot com>
Hi,
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:
tc-arm.c:
bfd_boolean
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
fixP->fx_r_type.
Nick