STT_GNU_IFUNC with OpenMP

Johannes Ziegenbalg johannes.ziegenbalg@gmail.com
Sun Sep 23 20:07:00 GMT 2012


On Fr, 2012-09-21 at 09:53 -0700, Ian Lance Taylor wrote:
> On Fri, Sep 21, 2012 at 6:30 AM, Johannes Ziegenbalg
> <johannes.ziegenbalg@gmail.com> wrote:
> >
> > I hope you can Help me with this. I wrote a GCC plugin for cloning
> > functions. This plugin also builds the resolver function and converts
> > the original function into a gnu_indirect_function.
> >
> > Now i got a problem, I'm compiling some Fortran code witch uses OpenMP
> > pragmas. Everything went fine, except for linking everything together.
> > There always is an SIGSEV or an error like:
> > "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol '...' with pointer equality
> > in '...' can not be used when making an executable; recompile with -fPIE
> > and relink with -pie"
> >
> > I know the error comes from the "_bfd_elf_allocate_ifunc_dyn_relocs"
> > function. I also found out that compiling with the -fopenmp option
> > causes the problems.
> > I can't figure out where exactly the problem is. Is the IFUNC attribute
> > not compatible with OpenMP or pthreads? Or is it a Bug?
> 
> GNU indirect functions, also known as IFUNCs, do not support pointer
> equality, unless you compile with -fPIE and link with -pie.  The
> linker is trying to tell you that you are comparing an IFUNC for
> pointer equality.
> 
> If you don't mean to do that, you need to look at your generated asm
> code to find out what is going on.
> 
> Ian

Thanks for your help. The artificial OpenMP functions caused the
problems. I don't know why but I don't need them anyways.

Johannes Z. 



More information about the Gcc-help mailing list