This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]