[PATCH] D93741: [lld-macho] Simulator executables should always be PIE

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 20:02:53 PST 2020


int3 created this revision.
int3 added a reviewer: lld-macho.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93741

Files:
  lld/MachO/Driver.cpp
  lld/test/MachO/x86-64-reloc-unsigned.s


Index: lld/test/MachO/x86-64-reloc-unsigned.s
===================================================================
--- lld/test/MachO/x86-64-reloc-unsigned.s
+++ lld/test/MachO/x86-64-reloc-unsigned.s
@@ -14,6 +14,8 @@
 # RUN: llvm-objdump --macho --rebase %t-pie | FileCheck %s --check-prefix=PIE
 # RUN: %lld -platform_version macos 10.5.0 11.0 -o %t-no-pie %t.o
 # RUN: llvm-objdump --macho --rebase %t-no-pie | FileCheck %s --check-prefix=NO-PIE
+# RUN: %lld -platform_version ios-simulator 11.0.0 14.2 -o %t-pie %t.o
+# RUN: llvm-objdump --macho --rebase %t-pie | FileCheck %s --check-prefix=PIE
 
 # CHECK:       Contents of section __DATA,foo:
 # CHECK-NEXT:  100001000 08100000 01000000
Index: lld/MachO/Driver.cpp
===================================================================
--- lld/MachO/Driver.cpp
+++ lld/MachO/Driver.cpp
@@ -641,6 +641,9 @@
       config->platform.minimum >= VersionTuple(10, 6))
     return true;
 
+  if (config->platform.kind == MachO::PlatformKind::iOSSimulator)
+    return true;
+
   return args.hasArg(OPT_pie);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93741.313475.patch
Type: text/x-patch
Size: 1060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201223/1c6e641d/attachment.bin>


More information about the llvm-commits mailing list