[PATCH, gas] PC-relative fx_offset calculation

Chung-Lin Tang cltang@codesourcery.com
Thu Mar 7 05:39:00 GMT 2013


On 2013/3/6 06:28 PM, Alan Modra wrote:
> On Wed, Mar 06, 2013 at 02:37:00PM +0800, Chung-Lin Tang wrote:
>> This is only lightly tested so far, WDYT? (I believe this patch should
>> make more sense now...)
> 
> Yes, it makes sense, but why is it that you need to call frag_more in
> the middle of assembling an instruction?  The normal course of action
> is to parse the insn, call frag_more when you know the size (or max
> size) of the insn, then emit insn bytes and any fixups.

I don't think the nios2 port is calling frag_more() like that. The
overall sequence of actions is like the way you described.

However it seems that, dot_value is recorded during the parsing (when
expression() is called), and the subsequent frag_more() call may create
a new frag, causing mismatch of fx_frag and fx_dot_value when creating
the new fix.

I am not sure why this has not been seen in other ports, as the
dot_value patch seems to have been there for a decade...

Chung-Lin



More information about the Binutils mailing list