Needs porting / support in binutils and glibc, and then some target configure magic for GCC. has a short summary about how to use it from GCC.

  • binutils

    Already passes the ifunc testsuite bits for GAS, but notably for LD (ld/testsuite/ld-ifunc/ifunc.exp), too, but that one contains a bunch of stuff explicitly tailored towards Linux. For example, we get *OS/ABI: UNIX

    • Linux*. (This should be fixed through using ELFOSABI GNU.)

    Most of the executables that the testsuite generates don't actually execute. (Though, this is partly due to the static issue.)

    $ tmpdir/local_prog 
    ifunc working correctly
    $ tmpdir/static_prog 
    $ tmpdir/dynamic_prog 
    tmpdir/dynamic_prog: error while loading shared libraries: ./tmpdir/ ELF file OS ABI invalid
    $ tmpdir/static_nonifunc_prog 
    $ tmpdir/test-1
    tmpdir/test-1: error while loading shared libraries: tmpdir/ ELF file OS ABI invalid
  • glibc

  • GCC

    In gcc/config.gcc, set default_gnu_indirect_function=yes for us, like done for GNU/Linux. See thread starting at id:"".