summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/rtld.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-01-08 17:11:49 +0000
committerkib <kib@FreeBSD.org>2011-01-08 17:11:49 +0000
commit5cec74bed917b7e7fe4e854d8ee69bbc3a117817 (patch)
tree0882ce7d12d36adab2adfd0186d9396cb4ab972f /libexec/rtld-elf/rtld.h
parent90de4ffc1a4a4d4d4f9f496f70a225b61a6acd34 (diff)
downloadFreeBSD-src-5cec74bed917b7e7fe4e854d8ee69bbc3a117817.zip
FreeBSD-src-5cec74bed917b7e7fe4e854d8ee69bbc3a117817.tar.gz
In rtld, read the initial stack access mode from AT_STACKPROT as set
by kernel, and parse PT_GNU_STACK phdr from linked and loaded dsos. If the loaded dso requires executable stack, as specified by PF_X bit of p_flags of PT_GNU_STACK phdr, but current stack protection does not permit execution, the __pthread_map_stacks_exec symbol is looked up and called. It should be implemented in libc or threading library and change the protection mode of all thread stacks to be executable. Provide a private interface _rtld_get_stack_prot() to export the stack access mode as calculated by rtld. Reviewed by: kan
Diffstat (limited to 'libexec/rtld-elf/rtld.h')
-rw-r--r--libexec/rtld-elf/rtld.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h
index b70e8b6..8941d29 100644
--- a/libexec/rtld-elf/rtld.h
+++ b/libexec/rtld-elf/rtld.h
@@ -157,6 +157,7 @@ typedef struct Struct_Obj_Entry {
const Elf_Phdr *phdr; /* Program header if it is mapped, else NULL */
size_t phsize; /* Size of program header in bytes */
const char *interp; /* Pathname of the interpreter, if any */
+ Elf_Word stack_flags;
/* TLS information */
int tlsindex; /* Index in DTV for this module */
OpenPOWER on IntegriCloud