How to find if any fixups were created for an instruction

Nick Clifton
Fri Apr 18 13:38:00 GMT 2008

Hi Kunal,

> So I need to know whether the instruction just
> assembled using CGEN has any fixups created for it. I looked through the
> code in cgen.c and found that they use a static variable num_fixups to
> track the number of fixups.
> Is there some way in which I can find out if fixups were created for
> current instruction ?

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.


More information about the Binutils mailing list