diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2017-01-24 10:21:54 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2017-01-24 10:21:54 +0000 |
commit | aab252f60e57e2001691ada865bcf9b698e24e78 (patch) | |
tree | edc3ab7e113dbce29425cd57cf3c23702aeeb00a | |
parent | 3fef385c33aca2c684ad8b7f169b0d7329ada0d5 (diff) |
PIE-by-default. Probably not suitable for upsttreaming in its current form.
-rw-r--r-- | gnu/llvm/tools/lld/ELF/Driver.cpp | 5 |
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, |