[PATCH] D14218: [ELF2] Implements -z relro: create an ELF "PT_GNU_RELRO" segment header in the object.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 1 09:21:54 PST 2015


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.

Partial (-z relro) and full (-z relro, -z now) relro cases are implemented.

Partial relro:
* The ELF sections are reordered so that the ELF internal data sections (.got, .dtors, etc.) precede the program's data sections (.data and .bss).
.got is readonly, .got.plt is still writeable.

Full relro:
* Supports all the features of partial RELRO, .got.plt is also readonly.

Notes:
Patch does not change the default behavior of linker. It looks that -z relro is default for gnu ld though.

http://reviews.llvm.org/D14218

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/Writer.cpp
  test/elf2/relro.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14218.38852.patch
Type: text/x-patch
Size: 11463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151101/fdfaf8fb/attachment.bin>


More information about the llvm-commits mailing list