[PATCH] D33251: [lld][ELF]Add option to make .dynamic read only

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 12:15:51 PDT 2017


jakehehrlich created this revision.
jakehehrlich added a project: lld.
Herald added a subscriber: arichardson.

The .dynamic section of an ELF almost doesn't need to be written to with the exception of the DT_DEBUG entry. For security reasons having a read only .dynamic section would be useful. MIPS already uses a solution to this that adds an address to a separate writable section. This change adds support for this option on non-MIPS targets. To make names not be MIPS specific MipsRldMapSection was made RldMapSection and DT_MIPS_RLD_MAP has the alternate name of DT_DEBUG_INDIRECT. To make non-MIPS targets emit a read only .dynamic section there is a -z keyword "rodynamic" which sets the appropriate flag. This flag is always set on MIPS.


Repository:
  rL LLVM

https://reviews.llvm.org/D33251

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/SyntheticSections.cpp
  ELF/SyntheticSections.h
  ELF/Writer.cpp
  test/ELF/Inputs/rodynamic.s
  test/ELF/rodynamic.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33251.99174.patch
Type: text/x-patch
Size: 8302 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170516/ae3b9c44/attachment.bin>


More information about the llvm-commits mailing list