[Bug tree-optimization/64703] glibc sysdeps/powerpc/powerpc64/dl-machine.h miscompile

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 21 02:45:00 GMT 2015


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);
}



More information about the Gcc-bugs mailing list