[lld] r298567 - [ELF] Add -z nodlopen option.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 17:54:16 PDT 2017
Author: davide
Date: Wed Mar 22 19:54:16 2017
New Revision: 298567
URL: http://llvm.org/viewvc/llvm-project?rev=298567&view=rev
Log:
[ELF] Add -z nodlopen option.
Patch by Mark Kettenis.
Modified:
lld/trunk/ELF/Config.h
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/SyntheticSections.cpp
lld/trunk/test/ELF/dt_flags.s
Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=298567&r1=298566&r2=298567&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Wed Mar 22 19:54:16 2017
@@ -142,6 +142,7 @@ struct Configuration {
bool ZExecstack;
bool ZNocopyreloc;
bool ZNodelete;
+ bool ZNodlopen;
bool ZNow;
bool ZOrigin;
bool ZRelro;
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=298567&r1=298566&r2=298567&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Wed Mar 22 19:54:16 2017
@@ -619,6 +619,7 @@ void LinkerDriver::readConfigs(opt::Inpu
Config->ZExecstack = hasZOption(Args, "execstack");
Config->ZNocopyreloc = hasZOption(Args, "nocopyreloc");
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");
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=298567&r1=298566&r2=298567&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Mar 22 19:54:16 2017
@@ -1034,6 +1034,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;
Modified: lld/trunk/test/ELF/dt_flags.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/dt_flags.s?rev=298567&r1=298566&r2=298567&view=diff
==============================================================================
--- lld/trunk/test/ELF/dt_flags.s (original)
+++ lld/trunk/test/ELF/dt_flags.s Wed Mar 22 19:54:16 2017
@@ -2,19 +2,19 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: ld.lld -shared %t -o %t.so
-# RUN: ld.lld -z now -z nodelete -z origin -Bsymbolic %t %t.so -o %t1
+# RUN: ld.lld -z now -z nodelete -z nodlopen -z origin -Bsymbolic %t %t.so -o %t1
# RUN: ld.lld %t %t.so -o %t2
# RUN: llvm-readobj -dynamic-table %t1 | FileCheck -check-prefix=FLAGS %s
# RUN: llvm-readobj -dynamic-table %t2 | FileCheck %s
# FLAGS: DynamicSection [
# FLAGS: 0x000000000000001E FLAGS ORIGIN SYMBOLIC BIND_NOW
-# FLAGS: 0x000000006FFFFFFB FLAGS_1 NOW NODELETE ORIGIN
+# FLAGS: 0x000000006FFFFFFB FLAGS_1 NOW NODELETE NOOPEN ORIGIN
# FLAGS: ]
# CHECK: DynamicSection [
# CHECK-NOT: 0x000000000000001E FLAGS ORIGIN SYMBOLIC BIND_NOW
-# CHECK-NOT: 0x000000006FFFFFFB FLAGS_1 NOW NODELETE ORIGIN
+# CHECK-NOT: 0x000000006FFFFFFB FLAGS_1 NOW NODELETE NOOPEN ORIGIN
# CHECK: ]
.globl _start
More information about the llvm-commits
mailing list