This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [SPARC] Segfault when resolving STT_GNU_IFUNC functions


On 06/06/2011 04:51 PM, David Miller wrote:
> As you discovered we can't depend upon GOT relocations being resolved
> at this point.  The only way I could come up to get the dl_hwcap value
> passed down to the IFUNC resolvers is to pass it in directly from the
> dynamic linker (where such symbol references are safe by the time we
> get to these things).

IFUNC resolvers are always going to be a bit special-case.
You need to use pc-relative or gp-relative relocations to
get to the symbols used therein.

E.g. for i386, @GOTOFF, not @GOT, etc.

Sparc is slightly deficient here, but you do have the
R_SPARC_PC10/22 relocations if you want to write all of
these functions by hand.  E.g. 

  ./sysdeps/powerpc/elf/ifunc-sel.h
vs
  ./sysdeps/generic/elf/ifunc-sel.h

Given that ifunc is an extension anyway, you might consider
adding gotoff-like relocations as well to make life a bit
easier, and teach gcc to use them for local data.


r~


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