public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RE: md_estimate_size_before_relax
@ 2003-11-26 11:12 Vineet Sharma, Noida
  2003-11-26 11:56 ` md_estimate_size_before_relax Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Vineet Sharma, Noida @ 2003-11-26 11:12 UTC (permalink / raw)
  To: Alan Modra, Vineet Sharma, Noida; +Cc: binutils

Hi Alan,
           When is second time md_estimate_size_before_realx() called? .It
is being called only once in relax_segment().
Should i call it explictly in my code after md_convert_frag()?


Thanks in advance
Vineet

-----Original Message-----
From: Alan Modra [mailto:amodra@bigpond.net.au]
Sent: Wednesday, November 26, 2003 4:18 PM
To: Vineet Sharma, Noida
Cc: binutils@sources.redhat.com
Subject: Re: md_estimate_size_before_relax


On Wed, Nov 26, 2003 at 03:17:54PM +0530, Vineet Sharma, Noida wrote:
> Hi All,
>        In GAS assembler "Is it very necessary that
> md_estimate_size_before_relax() calculates exact size for relaxation? "
> If yes
> 	We can never calculate all the the target address which are in the
> forwad frags(becuase we dont know how much they gonna relax)?
> 
> If no
> 	Then the final address is caclulated based on the return value of
> md_estimate_size_before_relax(), which would be always wrong(when writing
> the file).

It is an iterative process.  Typically, the initial size and addresses
of frags are based on the assumption that the smallest possible
instructions (eg. branches) will work.  The first time
md_estimate_size_before_relax is called, it should use these addresses
in determining whether larger instructions are needed.  If any larger
instructions are needed, gas will update the frag sizes and addresses,
and the whole process will repeat until no further changes are made.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: md_estimate_size_before_relax
  2003-11-26 11:12 md_estimate_size_before_relax Vineet Sharma, Noida
@ 2003-11-26 11:56 ` Alan Modra
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2003-11-26 11:56 UTC (permalink / raw)
  To: Vineet Sharma, Noida; +Cc: binutils

On Wed, Nov 26, 2003 at 04:44:10PM +0530, Vineet Sharma, Noida wrote:
> Hi Alan,
>            When is second time md_estimate_size_before_realx() called? .It
> is being called only once in relax_segment().

See the loop at write.c line 1539.

> Should i call it explictly in my code after md_convert_frag()?

No.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: md_estimate_size_before_relax
  2003-11-26  9:44 md_estimate_size_before_relax Vineet Sharma, Noida
@ 2003-11-26 10:47 ` Alan Modra
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2003-11-26 10:47 UTC (permalink / raw)
  To: Vineet Sharma, Noida; +Cc: binutils

On Wed, Nov 26, 2003 at 03:17:54PM +0530, Vineet Sharma, Noida wrote:
> Hi All,
>        In GAS assembler "Is it very necessary that
> md_estimate_size_before_relax() calculates exact size for relaxation? "
> If yes
> 	We can never calculate all the the target address which are in the
> forwad frags(becuase we dont know how much they gonna relax)?
> 
> If no
> 	Then the final address is caclulated based on the return value of
> md_estimate_size_before_relax(), which would be always wrong(when writing
> the file).

It is an iterative process.  Typically, the initial size and addresses
of frags are based on the assumption that the smallest possible
instructions (eg. branches) will work.  The first time
md_estimate_size_before_relax is called, it should use these addresses
in determining whether larger instructions are needed.  If any larger
instructions are needed, gas will update the frag sizes and addresses,
and the whole process will repeat until no further changes are made.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* md_estimate_size_before_relax
@ 2003-11-26  9:44 Vineet Sharma, Noida
  2003-11-26 10:47 ` md_estimate_size_before_relax Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Vineet Sharma, Noida @ 2003-11-26  9:44 UTC (permalink / raw)
  To: binutils

Hi All,
       In GAS assembler "Is it very necessary that
md_estimate_size_before_relax() calculates exact size for relaxation? "
If yes
	We can never calculate all the the target address which are in the
forwad frags(becuase we dont know how much they gonna relax)?

If no
	Then the final address is caclulated based on the return value of
md_estimate_size_before_relax(), which would be always wrong(when writing
the file).


Please help me out with the logic behind it.


Regsrds
vineet

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

end of thread, other threads:[~2003-11-26 11:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-26 11:12 md_estimate_size_before_relax Vineet Sharma, Noida
2003-11-26 11:56 ` md_estimate_size_before_relax Alan Modra
  -- strict thread matches above, loose matches on Subject: below --
2003-11-26  9:44 md_estimate_size_before_relax Vineet Sharma, Noida
2003-11-26 10:47 ` md_estimate_size_before_relax 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).