[PATCH] D62106: [X86] Support -fno-plt __tls_get_addr calls

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 7 07:23:04 PDT 2019


nikic added a comment.

> ld.bfd doesn't allow R_X86_64_GOTPCREL. You can work around the issue with:
> 
>   % clang -fno-plt -fpic a.cc -Wa,-mrelax-relocations=yes -fuse-ld=bfd

Thanks, I've verified that setting `RelaxELFRelocations` in `TargetOptions` indeed works around the issue. I'm a bit concerned about what other compatibility issues this will cause though. If I understood correctly, relax relocations is a relatively recent feature and not compatible with older linkers, so may not be a suitable compiler default.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62106





More information about the llvm-commits mailing list