[PATCH] Fix IA-64 -pie support

Jakub Jelinek jakub@redhat.com
Wed Jul 2 18:15:00 GMT 2003


On Wed, Jul 02, 2003 at 10:59:40AM -0700, Richard Henderson wrote:
> On Wed, Jul 02, 2003 at 02:30:23PM +0200, Jakub Jelinek wrote:
> > While working on this, I've noticed that assembling and linking into shlib
> > of the following
> > addl r2 = @ltoff(@fptr(foobar)), gp
> > addl r3 = @ltoff(foobar), gp
> > creates only one .got entry, as if both relocations were @ltoff(@fptr()).
> > Is that on purpose?
> 
> No, that is a bug.  Of course, that shouldn't be generated either.
> How did this come up, just inspection?

Yeah. So, should ld issue error if setting want_ltoff_fptr and
want_got/want_gotx is already defined or if setting want_got/want_gotx
for something other than @ltoff(@fptr()) and want_ltoff_fptr is not defined?

> > +      if (info->pie)
> > +	{
> > +	  asection *fptr_rel;
> > +	  fptr_rel = bfd_make_section(abfd, ".rela.opd");
> > +	  if (fptr_rel == NULL
> > +	      || !bfd_set_section_flags (abfd, fptr_rel,
> > +					 (SEC_ALLOC | SEC_LOAD
> > +					  | SEC_HAS_CONTENTS
> > +					  | SEC_IN_MEMORY
> > +					  | SEC_LINKER_CREATED
> > +					  | SEC_READONLY))
> > +	      || !bfd_set_section_alignment (abfd, fptr_rel, 3))
> > +	    {
> > +	      BFD_ASSERT (0);
> > +	      return NULL;
> > +	    }
> > +
> > +	  ia64_info->rel_fptr_sec = fptr_rel;
> > +	}
> >      }
> >  
> >    return fptr;
> 
> Hum.  I'd think that it'd be better to not generate descriptors
> in .opd when they're mutable, but instead let ld.so generate them.

I talked about it with Ulrich this morning and he thinks the FPTR handling
in ld.so is more costly (compared to relocating local IPLT64LSB relocs
and the additional memory footprint for the relocations).

	Jakub



More information about the Binutils mailing list