This is the mail archive of the binutils@sourceware.org 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]

Re: How to find if any fixups were created for an instruction


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.

Cheers
  Nick


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