This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: GAS relaxation: estimation in md_relax_frag() do not match md_apply_fix()
- From: Alan Modra <amodra at gmail dot com>
- To: William Tambe <tambewilliam at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 5 Mar 2020 11:19:19 +1030
- Subject: Re: GAS relaxation: estimation in md_relax_frag() do not match md_apply_fix()
- References: <CAF8i9mNvX4M4g1x8P0gm7c5fz5ONv5_9BuwWwtzxRxRHb2cEgg@mail.gmail.com>
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