GAS relaxation: estimation in md_relax_frag() do not match md_apply_fix()

Alan Modra amodra@gmail.com
Thu Mar 5 00:49:00 GMT 2020


On Tue, Mar 03, 2020 at 11:02:55PM -0500, William Tambe wrote:
> In our Binutils port, GAS relaxing is done implementing md_relax_frag()
> such that the displacement used to generate the growth amount to return
> is computed using:
> ((S_GET_VALUE (symbolP) + fragP->fr_offset) -
> (fragP->fr_address + fragP->fr_fix));
> 
> However, during md_apply_fix(), the same displacement value is greatly
> different, causing it not to fit in the relocation fix estimated
> during md_relax_frag().
> 
> Any idea what could explain it ?

A debugger is a great learning tool.  Especially one with watchpoints.
Use gdb to see where and how parts of fragP change.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list