This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: md_estimate_size_before_relax
- From: "Vineet Sharma, Noida" <vineets at noida dot hcltech dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>, "Vineet Sharma, Noida" <vineets at noida dot hcltech dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 26 Nov 2003 16:44:10 +0530
- Subject: RE: md_estimate_size_before_relax
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