STT_GNU_IFUNC with OpenMP
Ian Lance Taylor
iant@google.com
Fri Sep 21 16:53:00 GMT 2012
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
More information about the Gcc-help
mailing list