[PATCH] D42217: Set Module Metadata "AvoidPLT" when -fno-plt is used.
Sriraman Tallam via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 18 15:14:27 PST 2018
tmsriram updated this revision to Diff 130500.
tmsriram added a comment.
METADATA tag changed to "RtLibUseGOT". Also see: https://reviews.llvm.org/D42224/
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.130500.patch
Type: text/x-patch
Size: 952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180118/38cb401d/attachment.bin>
More information about the cfe-commits
mailing list