llvm-project/llvm/test
Fangrui Song f9ca13cb5f [X86] -fno-plt: use GOT __tls_get_addr only if GOTPCRELX is enabled
Summary:
As of binutils 2.32, ld has a bogus TLS relaxation error when the GD/LD
code sequence using R_X86_64_GOTPCREL (instead of R_X86_64_GOTPCRELX) is
attempted to be relaxed to IE/LE (binutils PR24784). gold and lld are good.

In gcc/config/i386/i386.md, there is a configure-time check of as/ld
support and the GOT relaxation will not be used if as/ld doesn't support
it:

    if (flag_plt || !HAVE_AS_IX86_TLS_GET_ADDR_GOT)
      return "call\t%P2";
    return "call\t{*%p2@GOT(%1)|[DWORD PTR %p2@GOT[%1]]}";

In clang, -DENABLE_X86_RELAX_RELOCATIONS=OFF is the default. The ld.bfd
bogus error can be reproduced with:

    thread_local int a;
    int main() { return a; }

clang -fno-plt -fpic a.cc -fuse-ld=bfd

GOTPCRELX gained relative good support in 2016, which is considered
relatively new.  It is even difficult to conditionally default to
-DENABLE_X86_RELAX_RELOCATIONS=ON due to cross compilation reasons. So
work around the ld.bfd bug by only using GOT when GOTPCRELX is enabled.

Reviewers: dalias, hjl.tools, nikic, rnk

Reviewed By: nikic

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64304

llvm-svn: 365752
2019-07-11 10:10:09 +00:00
..
Analysis [SCEV] teach SCEV symbolical execution about overflow intrinsics folding. 2019-07-11 02:18:22 +00:00
Assembler [ThinLTO] Attempt to recommit r365188 after alignment fix 2019-07-05 15:25:05 +00:00
Bindings [NFC] Adjust "invalid.ll.bc" tests to check for AttrKind #255 not #63 2019-07-11 01:14:30 +00:00
Bitcode [BitcodeReader] Validate OpNum, before accessing Record array. 2019-07-11 09:57:00 +00:00
BugPoint
CodeGen [X86] -fno-plt: use GOT __tls_get_addr only if GOTPCRELX is enabled 2019-07-11 10:10:09 +00:00
DebugInfo Make pdbdump-objfilename test work again 2019-07-09 17:02:51 +00:00
Demangle
Examples
ExecutionEngine Re-apply r364600 with fixes. 2019-06-28 18:36:59 +00:00
Feature Add, and infer, a nofree function attribute 2019-07-08 15:57:56 +00:00
FileCheck [FileCheck] Don't diagnose undef vars at parse time 2019-07-05 16:25:33 +00:00
Instrumentation hwasan: Improve precision of checks using short granule tags. 2019-07-09 20:22:36 +00:00
Integer
JitListener [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
LTO [NFC] Adjust "invalid.ll.bc" tests to check for AttrKind #255 not #63 2019-07-11 01:14:30 +00:00
Linker
MC [ARM] Remove nonexistent unsigned forms of MVE VQDMLAH. 2019-07-11 09:52:15 +00:00
MachineVerifier GlobalISel: Verify G_MERGE_VALUES operand sizes 2019-07-01 18:01:35 +00:00
Object [test/Object/nm-trivial-object.test] - Remove 4 precompiled binaries. 2019-07-10 08:40:11 +00:00
ObjectYAML [yaml2obj][MachO] Don't fill dummy data for virtual sections 2019-06-17 02:07:20 +00:00
Other Scalable Vector IR Type with further LTO fixes 2019-07-05 12:48:16 +00:00
SafepointIRVerifier
Support [llvm-dwarfdump] Remove unnecessary explicit -h behaviour 2019-06-21 11:22:20 +00:00
SymbolRewriter
TableGen [CodeGen] Add larger vector types for i32 and f32 2019-07-07 04:47:37 +00:00
ThinLTO/X86 [ThinLTO] only emit used or referenced CFI records to index 2019-07-09 18:50:55 +00:00
Transforms [InstCombine][NFCI] Add test coverage to onehot_merge.ll 2019-07-11 04:56:37 +00:00
Unit
Verifier Scalable Vector IR Type with further LTO fixes 2019-07-05 12:48:16 +00:00
YAMLParser
tools Revert [llvm-objcopy] Allow strip symtab from executables and DSOs 2019-07-10 23:32:44 +00:00
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py
lit.site.cfg.py.in