Relocations reference local (static or hidden) symbols on ia64

Alan Modra amodra@gmail.com
Sat Sep 25 00:44:54 GMT 2021


On Fri, Sep 24, 2021 at 02:18:54PM +0200, Andreas Schwab wrote:
> On Sep 24 2021, Alan Modra wrote:
> 
> > On Thu, Sep 23, 2021 at 10:40:39PM +0200, Florian Weimer via Binutils wrote:
> >> * Andreas Schwab:
> >> 
> >> > On Sep 23 2021, Florian Weimer via Binutils wrote:
> >> >
> >> >> Relocation section '.rela.dyn' at offset 0xeb8 contains 53 entries:
> >> >>     Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
> >> >> […]
> >> >> 0000000000061608  0000001800000047 R_IA64_FPTR64LSB       000000000001dc00 openaux + 0
> >> >
> >> > This relocation creates the "official" function descriptor for the
> >> > function (which serves as the unique address of the function).
> >> 
> >> Oh.  _dl_make_fptr is … complex.
> >> 
> >> For a static function such as openaux, I would have expected the static
> >> linker to allocate space for a function descriptor and initialize it
> >> using an R_IA64_REL64LSB relocation.
> >
> > Yes, or perhaps a different relocation.
> 
> Or let the compiler allocate the descriptor (which it already does for
> vtables, see TARGET_VTABLE_USES_DESCRIPTORS).

I don't see any good reason to not allocate fptrs in the linker for
local symbols in shared libraries, but that is what ia64 ld does,
apparently deliberately.

elfnn-ia64.c:2553
	  /* FPTRs for shared libraries are allocated by the dynamic
	     linker.  Make sure this local symbol will appear in the
	     dynamic symbol table.  */
	  if (!h && bfd_link_pic (info))

ia64 ld does allocate fptrs for fixed position executables..

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list