This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: How to find if any fixups were created for an instruction
- From: "Kunal Parmar" <kunalparmar at gmail dot com>
- To: "Nick Clifton" <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 22 Apr 2008 17:11:45 -0400
- Subject: Re: How to find if any fixups were created for an instruction
- References: <48051AAB.9030406@gmail.com> <4808A448.7040704@redhat.com>
Hi Nick,
On Fri, Apr 18, 2008 at 9:38 AM, Nick Clifton <nickc@redhat.com> wrote:
> You could define the macros TC_FIX_TYPE and TC_INIT_FIX_DATA and use them
> to keep track of the frag and offset of the most recently allocated fixup.
> Then you could compare this info to the info for the current instruction to
> see if it has fixups.
>
> You could cache values of the num_fixups variable each time you generate an
> instruction and then compare the current value with previous cached values
> to see how many fixups have been created for the current instruction.
>
> You could scan the list of fixups for the current section and look for any
> that are in the current frag/offset as the current instruction.
I have defined the macro TC_CGEN_PARSE_FIX_EXP and am using it to
to check if a fixup was created like this :
#define TC_CGEN_PARSE_FIX_EXP(opinfo, exp) \
brc_cgen_parse_fix_exp(opinfo, exp)
extern int brc_cgen_parse_fix_exp (int, expressionS *);
int
brc_cgen_parse_fix_exp (int opinfo, expressionS * exp)
{
if (exp->X_op != O_illegal && exp->X_op != O_absent
&& exp->X_op != O_constant && exp->X_op != O_register)
fixup_created = 1;
return opinfo;
}
Is it correct ?
Thanks in advance,
Kunal Parmar