From fa2bd37d2e6baa31b6e59c299cf8f4062b041343 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 18 Mar 2017 16:36:57 +0000 Subject: Add support for -znodlopen. ok patrick@ --- gnu/llvm/tools/lld/ELF/Config.h | 1 + gnu/llvm/tools/lld/ELF/Driver.cpp | 1 + gnu/llvm/tools/lld/ELF/SyntheticSections.cpp | 2 ++ 3 files changed, 4 insertions(+) (limited to 'gnu') diff --git a/gnu/llvm/tools/lld/ELF/Config.h b/gnu/llvm/tools/lld/ELF/Config.h index b7706205a5b..f58e3e5715b 100644 --- a/gnu/llvm/tools/lld/ELF/Config.h +++ b/gnu/llvm/tools/lld/ELF/Config.h @@ -135,6 +135,7 @@ struct Configuration { bool ZCombreloc; bool ZExecstack; bool ZNodelete; + bool ZNodlopen; bool ZNow; bool ZOrigin; bool ZRelro; diff --git a/gnu/llvm/tools/lld/ELF/Driver.cpp b/gnu/llvm/tools/lld/ELF/Driver.cpp index c6e69c5bb4b..3cf88e3c1ca 100644 --- a/gnu/llvm/tools/lld/ELF/Driver.cpp +++ b/gnu/llvm/tools/lld/ELF/Driver.cpp @@ -537,6 +537,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) { Config->ZCombreloc = !hasZOption(Args, "nocombreloc"); Config->ZExecstack = hasZOption(Args, "execstack"); Config->ZNodelete = hasZOption(Args, "nodelete"); + Config->ZNodlopen = hasZOption(Args, "nodlopen"); Config->ZNow = hasZOption(Args, "now"); Config->ZOrigin = hasZOption(Args, "origin"); Config->ZRelro = !hasZOption(Args, "norelro"); diff --git a/gnu/llvm/tools/lld/ELF/SyntheticSections.cpp b/gnu/llvm/tools/lld/ELF/SyntheticSections.cpp index b673a4ece1d..d1b6755ab2c 100644 --- a/gnu/llvm/tools/lld/ELF/SyntheticSections.cpp +++ b/gnu/llvm/tools/lld/ELF/SyntheticSections.cpp @@ -816,6 +816,8 @@ template void DynamicSection::addEntries() { DtFlags |= DF_SYMBOLIC; if (Config->ZNodelete) DtFlags1 |= DF_1_NODELETE; + if (Config->ZNodlopen) + DtFlags1 |= DF_1_NOOPEN; if (Config->ZNow) { DtFlags |= DF_BIND_NOW; DtFlags1 |= DF_1_NOW; -- cgit v1.2.3