Needs porting / support in binutils and glibc, and then some target configure magic for GCC.
http://nickclifton.livejournal.com/6612.html 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 Killed $ tmpdir/dynamic_prog tmpdir/dynamic_prog: error while loading shared libraries: ./tmpdir/libshared_ifunc.so: ELF file OS ABI invalid $ tmpdir/static_nonifunc_prog Killed $ tmpdir/test-1 tmpdir/test-1: error while loading shared libraries: tmpdir/libshared_ifunc.so: ELF file OS ABI invalid
-
In
gcc/config.gcc
, setdefault_gnu_indirect_function=yes
for us, like done for GNU/Linux. See thread starting atid:"CAFULd4YZsAQ6ckFjXtU5-yyv=3tYQwTJOPhU9zmJxFOrnotj8g@mail.gmail.com"
.