From 9131f5a7ac0fceee2ea1dac1b5f451cb133c6cce Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Mon, 13 May 2019 00:07:06 +0000 Subject: Add support for -znoretpolineplt and make -zretpolineplt the default. Affects i386 and amd64 only. ok deraadt@ kettenis@ --- gnu/llvm/tools/lld/ELF/Driver.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gnu/llvm/tools/lld/ELF/Driver.cpp b/gnu/llvm/tools/lld/ELF/Driver.cpp index c064d307698..e425a289aa4 100644 --- a/gnu/llvm/tools/lld/ELF/Driver.cpp +++ b/gnu/llvm/tools/lld/ELF/Driver.cpp @@ -344,7 +344,8 @@ static bool isKnown(StringRef S) { S == "keep-text-section-prefix" || S == "lazy" || S == "muldefs" || S == "nocombreloc" || S == "nocopyreloc" || S == "nodelete" || S == "nodlopen" || S == "noexecstack" || - S == "nokeep-text-section-prefix" || S == "norelro" || S == "notext" || + S == "nokeep-text-section-prefix" || S == "norelro" || + S == "noretpolineplt" || S == "notext" || S == "now" || S == "origin" || S == "relro" || S == "retpolineplt" || S == "rodynamic" || S == "text" || S == "wxneeded" || S.startswith("max-page-size=") || S.startswith("stack-size="); @@ -860,7 +861,11 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) { Config->ZNow = getZFlag(Args, "now", "lazy", false); Config->ZOrigin = hasZOption(Args, "origin"); Config->ZRelro = getZFlag(Args, "relro", "norelro", true); - Config->ZRetpolineplt = hasZOption(Args, "retpolineplt"); +#ifndef __OpenBSD__ + Config->ZRetpolineplt = getZFlag(Args, "retpolineplt", "noretpolineplt", false); +#else + Config->ZRetpolineplt = getZFlag(Args, "retpolineplt", "noretpolineplt", true); +#endif Config->ZRodynamic = hasZOption(Args, "rodynamic"); Config->ZStackSize = args::getZOptionValue(Args, OPT_z, "stack-size", 0); Config->ZText = getZFlag(Args, "text", "notext", true); -- cgit v1.2.3