[PATCH] D113443: [FreeBSD] avoid marking __stack_chk_guard symbol as dso_local on PPC64

Alfredo Dal'Ava JĂșnior via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 15:17:28 PST 2021


adalava added a comment.

In D113443#3147470 <https://reviews.llvm.org/D113443#3147470>, @MaskRay wrote:

> `readelf -r` without `-W` may not show the full relocation type name.
> The relocation type is `R_X86_64_REX_GOTPCRELX`, not `R_X86_64_REX_GOTP`.
>
> As I mentioned, `-fno-pic` may need GOT-generating relocations as well to avoid copy relocations. Not handling `R_X86_64_REX_GOTPCRELX` is FreeBSD's limitation which should be fixed https://maskray.me/blog/2021-08-29-all-about-global-offset-table
>
> I haven't read all the PowerPC discussions but it seems that there may be a dso_local PowerPC64 ELFv2 issue as well which should be properly fixed.
>
> With all these said, I am fine that this is pushed to fix the immediate problem for FreeBSD. But if FreeBSD 14.0.0 plans to fix `R_X86_64_REX_GOTPCRELX`, this patch is probably not very necessary.
>
> The issue could also be avoided by defaulting to `-mstack-protector-guard=tls` for FreeBSD, like Linux.

I don't think fixing `R_X86_64_REX_GOTPCRELX` is planned, we should open a bug for this.

@MaskRay @nemanjai Would be possible to make this patch backported in time for LLVM 13.1 release? With D109090 <https://reviews.llvm.org/D109090> alone FreeBSD/powerpc64* regression is fixed, but introduces a new regression affecting FreeBSD/amd64.
The FreeBSD sources already contain this patch but there are other ports/packages that uses LLVM "vanilla" sources.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113443



More information about the llvm-commits mailing list