[PATCH] D18403: Access protected symbols via GOT, even in non-PIC mode

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 09:54:23 PDT 2016


joerg created this revision.
joerg added reviewers: hjl.tools, rafael, nadav.
joerg added a subscriber: llvm-commits.
joerg set the repository for this revision to rL LLVM.

Access to protected symbols is special as they can be interposed. Compare https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for the history.

This patch introduces a new predicate on Global Value to decide whether a symbol can be interposed. Hidden and local symbols can never be interposed. Protected symbols are safe as well, if they are actually defined. Common linkage counts as definition here. The rest of the patch teaches the X86 target about using PIC access for interposable protected symbols, even when not doing PIC normally. This is required to avoid copy relocations, which would change the address and are rejected by newer binutils versions.

Repository:
  rL LLVM

http://reviews.llvm.org/D18403

Files:
  include/llvm/IR/GlobalValue.h
  lib/Target/X86/X86FastISel.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86InstrInfo.cpp
  lib/Target/X86/X86Subtarget.cpp
  test/CodeGen/X86/protected.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18403.51438.patch
Type: text/x-patch
Size: 7464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160323/b7719d74/attachment.bin>


More information about the llvm-commits mailing list