diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp --- a/lld/MachO/Driver.cpp +++ b/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); } diff --git a/lld/test/MachO/x86-64-reloc-unsigned.s b/lld/test/MachO/x86-64-reloc-unsigned.s --- a/lld/test/MachO/x86-64-reloc-unsigned.s +++ b/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