[lld-macho] Make everything PIE by default
authorJez Ng <jezng@fb.com>
Thu, 29 Apr 2021 19:09:01 +0000 (15:09 -0400)
committerJez Ng <jezng@fb.com>
Thu, 29 Apr 2021 19:11:23 +0000 (15:11 -0400)
commit7e115da5df47dbbbef141987845c1258f0c52874
tree2f571699950061a930607fcbc9a5aa7a4a81e7d4
parenta6d92a971175d727873a9e7644913ee02d7232a8
[lld-macho] Make everything PIE by default

Modern versions of macOS (>= 10.7) and in general all modern Mach-O
target archs want PIEs by default. ld64 defaults to PIE for iOS >= 4.3,
as well as for all versions of watchOS and simulators. Basically all the
platforms LLD is likely to target want PIE. So instead of cluttering LLD's
code with legacy version checks, I think it's simpler to just default to
PIE for everything.

Note that `-no_pie` still works, so users can still opt out of it.

Reviewed By: #lld-macho, thakis, MaskRay

Differential Revision: https://reviews.llvm.org/D101513
lld/MachO/Driver.cpp
lld/MachO/Options.td
lld/test/MachO/x86-64-reloc-unsigned.s