1e9ce7
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
1e9ce7
index 638b2a7b5a9f..79d4ecf4cb91 100644
1e9ce7
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
1e9ce7
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
1e9ce7
@@ -763,7 +763,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
1e9ce7
             && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie")
1e9ce7
         {
1e9ce7
             info!("linker output: {:?}", out);
1e9ce7
-            warn!("Linker does not support -no-pie command line option. Retrying without.");
1e9ce7
+            info!("Linker does not support -no-pie command line option. Retrying without.");
1e9ce7
             for arg in cmd.take_args() {
1e9ce7
                 if arg.to_string_lossy() != "-no-pie" {
1e9ce7
                     cmd.arg(arg);
1e9ce7
@@ -782,7 +782,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
1e9ce7
             && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie")
1e9ce7
         {
1e9ce7
             info!("linker output: {:?}", out);
1e9ce7
-            warn!(
1e9ce7
+            info!(
1e9ce7
                 "Linker does not support -static-pie command line option. Retrying with -static instead."
1e9ce7
             );
1e9ce7
             // Mirror `add_(pre,post)_link_objects` to replace CRT objects.
1e9ce7
@@ -1507,15 +1507,14 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1e9ce7
 }
1e9ce7
 
1e9ce7
 fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {
1e9ce7
-    let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) {
1e9ce7
+    // Only use PIE if explicitly specified.
1e9ce7
+    let explicit_pic =
1e9ce7
+        matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie));
1e9ce7
+    let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) {
1e9ce7
         (CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe,
1e9ce7
-        (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => {
1e9ce7
-            LinkOutputKind::DynamicPicExe
1e9ce7
-        }
1e9ce7
+        (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe,
1e9ce7
         (CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,
1e9ce7
-        (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => {
1e9ce7
-            LinkOutputKind::StaticPicExe
1e9ce7
-        }
1e9ce7
+        (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe,
1e9ce7
         (CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,
1e9ce7
         (_, true, _) => LinkOutputKind::StaticDylib,
1e9ce7
         (_, false, _) => LinkOutputKind::DynamicDylib,