use for the client stack.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13368
res = VG_(am_mmap_anon_fixed_client)(
anon_start -inner_HACK,
anon_size +inner_HACK,
- VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC
+ info->stack_prot
);
}
if ((!ok) || sr_isError(res)) {
info->phnum = e->e.e_phnum;
info->entry = e->e.e_entry + ebase;
info->phdr = 0;
+ info->stack_prot = VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC;
for (i = 0; i < e->e.e_phnum; i++) {
ESZ(Phdr) *ph = &e->p[i];
}
break;
+ case PT_GNU_STACK:
+ if ((ph->p_flags & PF_X) == 0) info->stack_prot &= ~VKI_PROT_EXEC;
+ if ((ph->p_flags & PF_W) == 0) info->stack_prot &= ~VKI_PROT_WRITE;
+ if ((ph->p_flags & PF_R) == 0) info->stack_prot &= ~VKI_PROT_READ;
+ break;
+
default:
// do nothing
break;
#if !defined(VGO_darwin)
Addr phdr; // OUT: address phdr was mapped at
Int phnum; // OUT: number of phdrs
+ UInt stack_prot; // OUT: stack permissions
Addr interp_base; // OUT: where interpreter (ld.so) was mapped
#else
Addr stack_start; // OUT: address of start of stack segment (hot)