[all-commits] [llvm/llvm-project] 37f0c8: [X86] Emit @PLT for x86-64 and keep unadorned symb...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Dec 5 13:18:05 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 37f0c8df47d84ba311fc9a2c1884935ba8961e84
      https://github.com/llvm/llvm-project/commit/37f0c8df47d84ba311fc9a2c1884935ba8961e84
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-12-05 (Sat, 05 Dec 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86Subtarget.cpp
    M llvm/test/CodeGen/X86/cvt16.ll
    M llvm/test/CodeGen/X86/extract-fp.ll
    M llvm/test/CodeGen/X86/extractelement-fp.ll
    M llvm/test/CodeGen/X86/finite-libcalls.ll
    M llvm/test/CodeGen/X86/fmaxnum.ll
    M llvm/test/CodeGen/X86/fmf-flags.ll
    M llvm/test/CodeGen/X86/fminnum.ll
    M llvm/test/CodeGen/X86/fp128-extract.ll
    M llvm/test/CodeGen/X86/fp128-i128.ll
    M llvm/test/CodeGen/X86/fp128-libcalls.ll
    M llvm/test/CodeGen/X86/half.ll
    M llvm/test/CodeGen/X86/llround-conv.ll
    M llvm/test/CodeGen/X86/lround-conv-i32.ll
    M llvm/test/CodeGen/X86/lround-conv-i64.ll
    M llvm/test/CodeGen/X86/memcpy-inline.ll
    M llvm/test/CodeGen/X86/memcpy.ll
    M llvm/test/CodeGen/X86/memset-nonzero.ll
    M llvm/test/CodeGen/X86/negative-sin.ll
    M llvm/test/CodeGen/X86/pow.ll
    M llvm/test/CodeGen/X86/powi.ll
    M llvm/test/CodeGen/X86/pr38865.ll
    M llvm/test/CodeGen/X86/vector-half-conversions.ll

  Log Message:
  -----------
  [X86] Emit @PLT for x86-64 and keep unadorned symbols for x86-32

This essentially reverts the x86-64 side effect of r327198.

For x86-32, @PLT (R_386_PLT32) is not suitable in -fno-pic mode so the
code forces MO_NO_FLAG (like a forced dso_local) (https://bugs.llvm.org//show_bug.cgi?id=36674#c6).

For x86-64, both `call/jmp foo` and `call/jmp foo at PLT` emit R_X86_64_PLT32
(https://sourceware.org/bugzilla/show_bug.cgi?id=22791) so there is no
difference using @PLT. Using @PLT is actually favorable because this drops
a difference with -fpie/-fpic code and makes it possible to avoid a canonical
PLT entry when taking the address of an undefined function symbol.




More information about the All-commits mailing list