diff options
Diffstat (limited to 'ldso/dynlink.c')
-rw-r--r-- | ldso/dynlink.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c index e4829c3a..3ecbddfa 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -609,6 +609,12 @@ static void *map_library(int fd, struct dso *dso) } else if (ph->p_type == PT_GNU_RELRO) { dso->relro_start = ph->p_vaddr & -PAGE_SIZE; dso->relro_end = (ph->p_vaddr + ph->p_memsz) & -PAGE_SIZE; + } else if (ph->p_type == PT_GNU_STACK) { + if (!runtime && ph->p_memsz > __default_stacksize) { + __default_stacksize = + ph->p_memsz < DEFAULT_STACK_MAX ? + ph->p_memsz : DEFAULT_STACK_MAX; + } } if (ph->p_type != PT_LOAD) continue; nsegs++; @@ -1238,6 +1244,12 @@ static void kernel_mapped_dso(struct dso *p) } else if (ph->p_type == PT_GNU_RELRO) { p->relro_start = ph->p_vaddr & -PAGE_SIZE; p->relro_end = (ph->p_vaddr + ph->p_memsz) & -PAGE_SIZE; + } else if (ph->p_type == PT_GNU_STACK) { + if (!runtime && ph->p_memsz > __default_stacksize) { + __default_stacksize = + ph->p_memsz < DEFAULT_STACK_MAX ? + ph->p_memsz : DEFAULT_STACK_MAX; + } } if (ph->p_type != PT_LOAD) continue; if (ph->p_vaddr < min_addr) |