Recommit r324107 again.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 7 Feb 2018 22:15:33 +0000 (22:15 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 7 Feb 2018 22:15:33 +0000 (22:15 +0000)
commit699f5d6bbc43fbd62e60f913379565bd86c6df8c
treed960a41f09b97d96b0eea7e8c5b7881b8bfa24a5
parent9bc04e98c5bd429cd49790ebf0a799c6a71427c5
Recommit r324107 again.

The difference from the previous try is that we no longer directly
access function declarations from position independent executables. It
should work, but currently doesn't with some linkers.

It now includes a fix to not mark available_externally definitions as
dso_local.

Original message:

Start setting dso_local in clang.

This starts adding dso_local to clang.

The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go
away. My objective for now is to move enough of it to clang to remove
the need for the TargetMachine one to handle PIE copy relocations and
-fno-plt. With that it should then be easy to implement a
-fno-copy-reloc in clang.

This patch just adds the cases where we assume a symbol to be local
based on the file being compiled for an executable or a shared
library.

llvm-svn: 324535
22 files changed:
clang/lib/CodeGen/CGDecl.cpp
clang/lib/CodeGen/CGVTT.cpp
clang/lib/CodeGen/CGVTables.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/lib/CodeGen/ItaniumCXXABI.cpp
clang/test/CodeGen/dso-local-executable.c [new file with mode: 0644]
clang/test/CodeGen/mbackchain-2.c
clang/test/CodeGen/mbackchain-3.c
clang/test/CodeGen/mips-vector-return.c
clang/test/CodeGen/split-stacks.c
clang/test/CodeGenCXX/debug-info-static-member.cpp
clang/test/CodeGenCXX/debug-info-template.cpp
clang/test/CodeGenCXX/dso-local-executable.cpp [new file with mode: 0644]
clang/test/CodeGenCXX/float16-declarations.cpp
clang/test/CodeGenCXX/split-stacks.cpp
clang/test/Driver/lanai-unknown-unknown.cpp
clang/test/Driver/le32-unknown-nacl.cpp
clang/test/Driver/le64-unknown-unknown.cpp
clang/test/Driver/riscv32-toolchain.c
clang/test/Driver/riscv64-toolchain.c
clang/test/Frontend/ast-codegen.c