commit | 9ec0f03a0d0b17bbb94ac0b9fef6add28a133c3a | [log] [tgz] |
---|---|---|
author | Nick Kralevich <nnk@google.com> | Tue Feb 28 10:40:00 2012 -0800 |
committer | Nick Kralevich <nnk@google.com> | Mon Mar 05 16:44:42 2012 -0800 |
tree | dde5e86b6ae51f92087a9034750c282e11884164 | |
parent | 1fe109ecf3b1acd10d55091f3e0eed7efeca98f1 [diff] [blame] |
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
diff --git a/linker/linker.h b/linker/linker.h index eb3c4c3..0c986cd 100644 --- a/linker/linker.h +++ b/linker/linker.h
@@ -31,7 +31,8 @@ #include <unistd.h> #include <sys/types.h> -#include <linux/elf.h> +#include <elf.h> +#include <sys/exec_elf.h> #undef PAGE_MASK #undef PAGE_SIZE @@ -143,6 +144,10 @@ struct link_map linkmap; int constructors_called; + + Elf32_Addr gnu_relro_start; + unsigned gnu_relro_len; + };