about summary refs log tree commit diff
path: root/compiler/rustc_session/src
diff options
context:
space:
mode:
authorAugie Fackler <augie@google.com>2023-06-07 20:18:20 -0400
committerAugie Fackler <augie@google.com>2023-06-22 14:29:22 -0400
commit34d0cffcdf49f336a6b20da5a786c6d9eda950ea (patch)
treefb5c5784f84f3f4c31f7e2267ba76fc9efc2b863 /compiler/rustc_session/src
parentdfc5218dc83d5de02f196b182938e4ac4428a543 (diff)
downloadrust-34d0cffcdf49f336a6b20da5a786c6d9eda950ea.tar.gz
rust-34d0cffcdf49f336a6b20da5a786c6d9eda950ea.zip
switch to using a target property to control plt default
Diffstat (limited to 'compiler/rustc_session/src')
-rw-r--r--compiler/rustc_session/src/session.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs
index fc54af73eab..ea5beb6f8be 100644
--- a/compiler/rustc_session/src/session.rs
+++ b/compiler/rustc_session/src/session.rs
@@ -1009,11 +1009,11 @@ impl Session {
         self.edition().rust_2024()
     }
 
-    /// Returns `true` if we cannot skip the PLT for shared library calls.
+    /// Returns `true` if we should use the PLT for shared library calls.
     pub fn needs_plt(&self) -> bool {
-        // Check if the current target usually needs PLT to be enabled.
+        // Check if the current target usually wants PLT to be enabled.
         // The user can use the command line flag to override it.
-        let needs_plt = self.target.arch != "x86_64";
+        let want_plt = self.target.plt_by_default;
 
         let dbg_opts = &self.opts.unstable_opts;
 
@@ -1025,8 +1025,8 @@ impl Session {
         let full_relro = RelroLevel::Full == relro_level;
 
         // If user didn't explicitly forced us to use / skip the PLT,
-        // then try to skip it where possible.
-        dbg_opts.plt.unwrap_or(needs_plt || !full_relro)
+        // then use it unless the target doesn't want it by default or the full relro forces it on.
+        dbg_opts.plt.unwrap_or(want_plt || !full_relro)
     }
 
     /// Checks if LLVM lifetime markers should be emitted.