[llvm] [BOLT][NFC] Clarify requirement of PLTCall pass (PR #164280)

Gergely Bálint via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 20 09:35:48 PDT 2025


https://github.com/bgergely0 updated https://github.com/llvm/llvm-project/pull/164280

>From 0a85d276d7469787d613ff668a5e921e7214e6a2 Mon Sep 17 00:00:00 2001
From: Gergely Balint <gergely.balint at arm.com>
Date: Mon, 20 Oct 2025 16:23:46 +0000
Subject: [PATCH] [BOLT][NFC] Clarify requirement of PLTCall pass

PLTCall does not depend on linking the input with -znow: it sets the
DF_BIND_NOW and/or DF_1_NOW tags for the output binary.
The requirement is that the input contains either FLAGS or FLAGS_1
dynamic entries.
---
 bolt/lib/Passes/PLTCall.cpp | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/bolt/lib/Passes/PLTCall.cpp b/bolt/lib/Passes/PLTCall.cpp
index 90b5f586a7bad..18e17bd15b505 100644
--- a/bolt/lib/Passes/PLTCall.cpp
+++ b/bolt/lib/Passes/PLTCall.cpp
@@ -22,16 +22,17 @@ namespace opts {
 
 extern cl::OptionCategory BoltOptCategory;
 
-static cl::opt<bolt::PLTCall::OptType>
-    PLT("plt", cl::desc("optimize PLT calls (requires linking with -znow)"),
-        cl::init(bolt::PLTCall::OT_NONE),
-        cl::values(clEnumValN(bolt::PLTCall::OT_NONE, "none",
-                              "do not optimize PLT calls"),
-                   clEnumValN(bolt::PLTCall::OT_HOT, "hot",
-                              "optimize executed (hot) PLT calls"),
-                   clEnumValN(bolt::PLTCall::OT_ALL, "all",
-                              "optimize all PLT calls")),
-        cl::ZeroOrMore, cl::cat(BoltOptCategory));
+static cl::opt<bolt::PLTCall::OptType> PLT(
+    "plt",
+    cl::desc(
+        "optimize PLT calls (sets DF_BIND_NOW/DF_1_NOW in the output binary)"),
+    cl::init(bolt::PLTCall::OT_NONE),
+    cl::values(
+        clEnumValN(bolt::PLTCall::OT_NONE, "none", "do not optimize PLT calls"),
+        clEnumValN(bolt::PLTCall::OT_HOT, "hot",
+                   "optimize executed (hot) PLT calls"),
+        clEnumValN(bolt::PLTCall::OT_ALL, "all", "optimize all PLT calls")),
+    cl::ZeroOrMore, cl::cat(BoltOptCategory));
 }
 
 namespace llvm {



More information about the llvm-commits mailing list