================
@@ -240,11 +242,32 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, 
const JobAction &JA,
   CmdArgs.push_back(
       Args.MakeArgString("--sysroot=" + TC.getSDKLibraryRootDir()));
 
-  // Default to PIE for non-static executables.
-  const bool PIE =
-      !Args.hasArg(options::OPT_r, options::OPT_shared, options::OPT_static);
-  if (Args.hasFlag(options::OPT_pie, options::OPT_no_pie, PIE))
-    CmdArgs.push_back("-pie");
+  if (!Relocatable) {
+    // Default to PIE for non-static executables.
+    const bool PIE = !Args.hasArg(options::OPT_shared, options::OPT_static);
+    if (Args.hasFlag(options::OPT_pie, options::OPT_no_pie, PIE))
+      CmdArgs.push_back("-pie");
----------------
pogo59 wrote:

These are small things but I'd be inclined to separate it out. Apart from being 
"in the driver" it's not really related, functionally, to the `-z` changes.

https://github.com/llvm/llvm-project/pull/113162
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to