[lld][ELF]Add option to make .dynamic read only
authorPetr Hosek <phosek@chromium.org>
Fri, 26 May 2017 19:12:38 +0000 (19:12 +0000)
committerPetr Hosek <phosek@chromium.org>
Fri, 26 May 2017 19:12:38 +0000 (19:12 +0000)
commitffa786f465547520a54eaa3f1b26ad4cd5b4223e
tree909450b1583df2623a5388a3342260f56d82073a
parent9bce1ad2327f6cd680fb860232452b5dd55ea623
[lld][ELF]Add option to make .dynamic read only

The .dynamic section of an ELF almost doesn't need to be written to with
the exception of the DT_DEBUG entry. For several reasons having a read
only .dynamic section would be useful. This change adds the -z keyword
"rodynamic" which forces .dynamic to be read-only. In this case DT_DEBUG
will not be emited.

Patch by Jake Ehrlich

Differential Revision: https://reviews.llvm.org/D33251

llvm-svn: 304024
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/SyntheticSections.cpp
lld/test/ELF/Inputs/rodynamic.s [new file with mode: 0644]
lld/test/ELF/rodynamic.s [new file with mode: 0644]