[PATCH] D42217: Set Module Metadata "AvoidPLT" when -fno-plt is used.
Sriraman Tallam via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 20 13:59:05 PST 2018
tmsriram updated this revision to Diff 135144.
tmsriram added a comment.
Updated patch.
https://reviews.llvm.org/D42217
Files:
lib/CodeGen/CodeGenModule.cpp
test/CodeGen/noplt.c
Index: test/CodeGen/noplt.c
===================================================================
--- test/CodeGen/noplt.c
+++ test/CodeGen/noplt.c
@@ -1,7 +1,8 @@
-// RUN: %clang_cc1 -emit-llvm -fno-plt %s -o - | FileCheck %s -check-prefix=CHECK-NOPLT
+// RUN: %clang_cc1 -emit-llvm -fno-plt %s -o - | FileCheck %s -check-prefix=CHECK-NOPLT -check-prefix=CHECK-NOPLT-METADATA
// CHECK-NOPLT: Function Attrs: nonlazybind
// CHECK-NOPLT-NEXT: declare {{.*}}i32 @foo
+// CHECK-NOPLT-METADATA: !"RtLibUseGOT"
int foo();
int bar() {
Index: lib/CodeGen/CodeGenModule.cpp
===================================================================
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -555,6 +555,10 @@
getModule().setPIELevel(static_cast<llvm::PIELevel::Level>(PLevel));
}
+ if (CodeGenOpts.NoPLT) {
+ getModule().setRtLibUseGOT();
+ }
+
SimplifyPersonality();
if (getCodeGenOpts().EmitDeclMetadata)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42217.135144.patch
Type: text/x-patch
Size: 952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180220/d71c122b/attachment.bin>
More information about the cfe-commits
mailing list