[PATCH] D109090: [PPC64] fix/workaround runtime crash on FreeBSD with llvm12 and later

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 17 12:17:18 PDT 2021


MaskRay added a comment.

In D109090#3004618 <https://reviews.llvm.org/D109090#3004618>, @emaste wrote:

> It looks like this worked prior to 2518433f861f <https://reviews.llvm.org/rG2518433f861fcb877d0a7bdd9aec1aec1f77505a> because `shouldAssumeDSOLocal` has this case:
>
>   // PPC has no copy relocations and cannot use a plt entry as a symbol address.
>   llvm::Triple::ArchType Arch = TT.getArch();
>   if (Arch == llvm::Triple::ppc || Arch == llvm::Triple::ppc64 ||
>       Arch == llvm::Triple::ppc64le)
>     return false;
>
> (later changed to `TT.isPPC64()` but same effect)

The ppc part was incorrect. ppc32 has copy relocations. `isPPC64` is because ELF v2 prefers TOC indirection for access to non-preemptible definitions, but the special condition was still spurious.

I am afraid the root cause is still unknown and this patch just papers over the issue.
I hope we have a good understanding why having dso_local will cause trouble on FreeBSD powerpc64's -fstack-protector* and fix the root cause instead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109090/new/

https://reviews.llvm.org/D109090



More information about the llvm-commits mailing list