md_estimate_size_before_relax

Alan Modra amodra@bigpond.net.au
Wed Nov 26 10:47:00 GMT 2003


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



More information about the Binutils mailing list