summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2018-01-20 00:28:02 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2018-01-20 00:28:02 +0000
commit99f479abcf2c9b36daad04eb91cd0aafa659bb1d (patch)
tree331bb5b7a64e0b50fc139438a3ab4277080f188f /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent08bd14803cf6a89700db914b68affe98879f4049 (diff)
downloadbcm5719-llvm-99f479abcf2c9b36daad04eb91cd0aafa659bb1d.tar.gz
bcm5719-llvm-99f479abcf2c9b36daad04eb91cd0aafa659bb1d.zip
CodeGen: handle llvm.used properly for COFF
`llvm.used` contains a list of pointers to named values which the compiler, assembler, and linker are required to treat as if there is a reference that they cannot see. Ensure that the symbols are preserved by adding an explicit `-include` reference to the linker command. llvm-svn: 323017
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index bdc4bc0302b..0e90df901fd 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -1250,6 +1250,11 @@ void TargetLoweringObjectFileCOFF::emitLinkerFlagsForGlobal(
emitLinkerFlagsForGlobalCOFF(OS, GV, getTargetTriple(), getMangler());
}
+void TargetLoweringObjectFileCOFF::emitLinkerFlagsForUsed(
+ raw_ostream &OS, const GlobalValue *GV) const {
+ emitLinkerFlagsForUsedCOFF(OS, GV, getTargetTriple(), getMangler());
+}
+
//===----------------------------------------------------------------------===//
// Wasm
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud