summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2017-01-24 10:21:54 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2017-01-24 10:21:54 +0000
commitaab252f60e57e2001691ada865bcf9b698e24e78 (patch)
treeedc3ab7e113dbce29425cd57cf3c23702aeeb00a
parent3fef385c33aca2c684ad8b7f169b0d7329ada0d5 (diff)
PIE-by-default. Probably not suitable for upsttreaming in its current form.
-rw-r--r--gnu/llvm/tools/lld/ELF/Driver.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/gnu/llvm/tools/lld/ELF/Driver.cpp b/gnu/llvm/tools/lld/ELF/Driver.cpp
index e8d865e8b81..e9425007530 100644
--- a/gnu/llvm/tools/lld/ELF/Driver.cpp
+++ b/gnu/llvm/tools/lld/ELF/Driver.cpp
@@ -493,7 +493,12 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
Config->NoUndefinedVersion = Args.hasArg(OPT_no_undefined_version);
Config->Nostdlib = Args.hasArg(OPT_nostdlib);
Config->OMagic = Args.hasArg(OPT_omagic);
+#ifdef __OpenBSD__
+ Config->Pie = getArg(Args, OPT_pie, OPT_nopie,
+ !Args.hasArg(OPT_shared) && !Args.hasArg(OPT_relocatable));
+#else
Config->Pie = getArg(Args, OPT_pie, OPT_nopie, false);
+#endif
Config->PrintGcSections = Args.hasArg(OPT_print_gc_sections);
Config->Relocatable = Args.hasArg(OPT_relocatable);
Config->DefineCommon = getArg(Args, OPT_define_common, OPT_no_define_common,