https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64703
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Even though I think there is a bug here. I think the best way to work around this issue is do: unsigned long resolve_ifunc (unsigned long value, const struct link_map *map, const struct link_map *sym_map) { Elf64_FuncDesc opd; if (map != sym_map && sym_map != dl_rtld_map && !sym_map->l_relocated) { Elf64_FuncDesc *func = (Elf64_FuncDesc *) value; opd.fd_func = func->fd_func + sym_map->l_addr; opd.fd_toc = func->fd_toc + sym_map->l_addr; opd.fd_aux = func->fd_aux; value = (unsigned long) &opd; } asm("":"+r"(value): : "memory"); return ((unsigned long (*) (unsigned long)) value) (dl_hwcap); }