[PATCH] D140813: [ELF][X86] Support TLS GD/LD relaxation for gcc -fno-plt

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 31 20:50:58 PST 2022


MaskRay created this revision.
Herald added subscribers: StephenFan, arichardson, emaste.
Herald added a project: All.
This revision was not accepted when it landed; it landed in state "Draft".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8dc73662ab5f: [ELF] Support TLS GD/LD relaxations for x86-32 -fno-plt (authored by MaskRay).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D140813?vs=485791&id=485794#toc

gcc -fno-plt uses `call *___tls_get_addr at GOT(%reg)` instead of `call ___tls_get_addr at PLT`.
GD to IE/LE relaxations need to shift the offset by one while LD to LE relaxation needs to use a different code sequence.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140813

Files:
  lld/ELF/Arch/X86.cpp
  lld/test/ELF/i386-tls-gdiele.s
  lld/test/ELF/i386-tls-opt.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140813.485794.patch
Type: text/x-patch
Size: 5165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230101/6b0501e8/attachment.bin>


More information about the llvm-commits mailing list