This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]