[PATCH] Avoid R_IA64_NONE relocations when relaxing

H. J. Lu hjl@lucon.org
Mon Aug 8 23:27:00 GMT 2005


On Mon, Aug 08, 2005 at 04:09:21PM -0700, H. J. Lu wrote:
> On Mon, Aug 08, 2005 at 03:55:30PM -0700, James E Wilson wrote:
> > On Sat, 2005-08-06 at 08:12, H. J. Lu wrote:
> > > On Sat, Aug 06, 2005 at 04:43:08PM +0200, Andreas Schwab wrote:
> > > ...
> > 
> > So we have three patches.  Anyone want to argue for or against any of
> > them?
> > 
> > The first patch from HJ, setting gp in elfNN_ia64_relax_section, does
> > not seem wise.  This is changing the gp value in the middle of a
> > relaxation pass.
> > 
> > The second patch from HJ, setting gp in elfNN_ia64_final_link, seems OK,
> > but has an incorrect comment.  It is possible for some sections to
> > increase in size when we start relaxation.  This happens when we insert
> > a trampoline for an out-of-range br.  However, no sections increase in
> > size after we start doing LTOFF22X relaxations, which is the important
> > part.
> 
> My comments says "We assume after gp is set, section size will only
> decrease." GP is set only when we start doing LTOFF22X relaxations.
> 
> > 
> > The patch from Andreas seems to have the most thought put into it, but
> > it is also by far the most invasive, so it would be nice to have a
> > reason to justify it.  It does seem to be modifying gp in the proper
> > place, before each relaxation pass.  I think this patch has the
> > potential to perform more LTOFF22X relaxations.  As we reduce section
> > sizes, more symbol addresses will come within range of gp, and hence
> 
> Not all section size reduction will lead to more LTOFF22X relaxations.
> I don't think the size of .rela.got section matters here. The most
> likely ones are .got and .IA64.pltoff. Can we reduce the size of
> .got or .IA64.pltoff during relaxation?
> 
> > more LTOFF22X relocations will get relaxed to GPREL22 relocs.  That may
> > be a good reason to go with this patch.
> 

One more thing, I think LTOFF22X relaxation is performed during the
final relaxation pass. Unless we can reduce the size of .data,
.got or .IA64.pltoff, there is no more LTOFF22X we can relax after
it is done the first time.


H.J.



More information about the Binutils mailing list