public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* GAS relaxation: estimation in md_relax_frag() do not match md_apply_fix()
@ 2020-03-04  4:03 William Tambe
  2020-03-05  0:49 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: William Tambe @ 2020-03-04  4:03 UTC (permalink / raw)
  To: Binutils

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 ?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: GAS relaxation: estimation in md_relax_frag() do not match md_apply_fix()
  2020-03-04  4:03 GAS relaxation: estimation in md_relax_frag() do not match md_apply_fix() William Tambe
@ 2020-03-05  0:49 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2020-03-05  0:49 UTC (permalink / raw)
  To: William Tambe; +Cc: Binutils

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-05  0:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04  4:03 GAS relaxation: estimation in md_relax_frag() do not match md_apply_fix() William Tambe
2020-03-05  0:49 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).