lld -znodlopen support

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

lld -znodlopen support

Mark Kettenis
Diff below adds support for -Wl,-znodlopen.  This fixes the
libexec/ld.so/df_1_noopen regression test.

ok?


Index: gnu/llvm/tools/lld/ELF/Config.h
===================================================================
RCS file: /cvs/src/gnu/llvm/tools/lld/ELF/Config.h,v
retrieving revision 1.2
diff -u -p -r1.2 Config.h
--- gnu/llvm/tools/lld/ELF/Config.h 24 Jan 2017 10:20:27 -0000 1.2
+++ gnu/llvm/tools/lld/ELF/Config.h 18 Mar 2017 15:14:56 -0000
@@ -135,6 +135,7 @@ struct Configuration {
   bool ZCombreloc;
   bool ZExecstack;
   bool ZNodelete;
+  bool ZNodlopen;
   bool ZNow;
   bool ZOrigin;
   bool ZRelro;
Index: gnu/llvm/tools/lld/ELF/Driver.cpp
===================================================================
RCS file: /cvs/src/gnu/llvm/tools/lld/ELF/Driver.cpp,v
retrieving revision 1.4
diff -u -p -r1.4 Driver.cpp
--- gnu/llvm/tools/lld/ELF/Driver.cpp 14 Mar 2017 08:11:34 -0000 1.4
+++ gnu/llvm/tools/lld/ELF/Driver.cpp 18 Mar 2017 15:14:56 -0000
@@ -537,6 +537,7 @@ void LinkerDriver::readConfigs(opt::Inpu
   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");
Index: gnu/llvm/tools/lld/ELF/SyntheticSections.cpp
===================================================================
RCS file: /cvs/src/gnu/llvm/tools/lld/ELF/SyntheticSections.cpp,v
retrieving revision 1.3
diff -u -p -r1.3 SyntheticSections.cpp
--- gnu/llvm/tools/lld/ELF/SyntheticSections.cpp 14 Mar 2017 08:11:34 -0000 1.3
+++ gnu/llvm/tools/lld/ELF/SyntheticSections.cpp 18 Mar 2017 15:14:56 -0000
@@ -816,6 +816,8 @@ template <class ELFT> void DynamicSectio
     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;

Reply | Threaded
Open this post in threaded view
|

Re: lld -znodlopen support

Patrick Wildt-3
On Sat, Mar 18, 2017 at 04:17:30PM +0100, Mark Kettenis wrote:
> Diff below adds support for -Wl,-znodlopen.  This fixes the
> libexec/ld.so/df_1_noopen regression test.
>
> ok?

Seems easy enough, looks good to me.

>
>
> Index: gnu/llvm/tools/lld/ELF/Config.h
> ===================================================================
> RCS file: /cvs/src/gnu/llvm/tools/lld/ELF/Config.h,v
> retrieving revision 1.2
> diff -u -p -r1.2 Config.h
> --- gnu/llvm/tools/lld/ELF/Config.h 24 Jan 2017 10:20:27 -0000 1.2
> +++ gnu/llvm/tools/lld/ELF/Config.h 18 Mar 2017 15:14:56 -0000
> @@ -135,6 +135,7 @@ struct Configuration {
>    bool ZCombreloc;
>    bool ZExecstack;
>    bool ZNodelete;
> +  bool ZNodlopen;
>    bool ZNow;
>    bool ZOrigin;
>    bool ZRelro;
> Index: gnu/llvm/tools/lld/ELF/Driver.cpp
> ===================================================================
> RCS file: /cvs/src/gnu/llvm/tools/lld/ELF/Driver.cpp,v
> retrieving revision 1.4
> diff -u -p -r1.4 Driver.cpp
> --- gnu/llvm/tools/lld/ELF/Driver.cpp 14 Mar 2017 08:11:34 -0000 1.4
> +++ gnu/llvm/tools/lld/ELF/Driver.cpp 18 Mar 2017 15:14:56 -0000
> @@ -537,6 +537,7 @@ void LinkerDriver::readConfigs(opt::Inpu
>    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");
> Index: gnu/llvm/tools/lld/ELF/SyntheticSections.cpp
> ===================================================================
> RCS file: /cvs/src/gnu/llvm/tools/lld/ELF/SyntheticSections.cpp,v
> retrieving revision 1.3
> diff -u -p -r1.3 SyntheticSections.cpp
> --- gnu/llvm/tools/lld/ELF/SyntheticSections.cpp 14 Mar 2017 08:11:34 -0000 1.3
> +++ gnu/llvm/tools/lld/ELF/SyntheticSections.cpp 18 Mar 2017 15:14:56 -0000
> @@ -816,6 +816,8 @@ template <class ELFT> void DynamicSectio
>      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;
>