Add relro support

Add support for PT_GNU_RELRO. This allows the static linker to
indicate that certain regions of memory should be marked as
"read-only" after dynamic linking is complete.

See:
  * http://www.akkadia.org/drepper/nonselsec.pdf (section 6)
  * http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html

Note that this change has no effect on Android right now, because
we don't compile our code with relro enabled.

Change-Id: I6541f8775367e8558b4388f7d105b1ae6e8f046b
This commit is contained in:
Nick Kralevich
2012-02-28 10:40:00 -08:00
parent 1fe109ecf3
commit 9ec0f03a0d
4 changed files with 69 additions and 7 deletions

View File

@@ -130,4 +130,6 @@
#define STT_LOPROC 13 /* reserved range for processor */
#define STT_HIPROC 15 /* specific symbol types */
#define PT_GNU_RELRO 0x6474e552 /* Read-only post relocation */
#endif /* _SYS_EXEC_ELF_H_ */