[PATCH] D85782: [X86][ELF] Prefer lowering MC_GlobalAddress operands to .Lfoo$local only for STV_DEFAULT globals

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 13:38:00 PDT 2020


bd1976llvm added a comment.

In D85782#2236493 <https://reviews.llvm.org/D85782#2236493>, @MaskRay wrote:

> tl;dr This is a longstanding GNU ld bug introduced in binutils 2.26
>
>   % cat a.c
>   __attribute__((visibility("protected"))) void * foo (void) { return (void *)foo; }
>   % gcc -fpic a.c -shared -fuse-ld=bfd # relocation R_X86_64_PC32 against protected symbol `foo' can not be used when making a shared object
>
> clang does not behave worse than GCC+GNU ld, so there is no regression on our side.

Sorry I was in a rush and made a mistake in my reply when I mentioned PLT relocations. That was just a mistake.. I meant to say that we could access via the GOT.

Thanks @MaskRay - awesome reply.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85782



More information about the llvm-commits mailing list