Revision 97374d38

b/linux-user/elfload.c
1018 1018
    /* we reserve one extra page at the top of the stack as guard */
1019 1019
    target_mprotect(error + size, qemu_host_page_size, PROT_NONE);
1020 1020

  
1021
    info->stack_limit = error;
1021 1022
    stack_base = error + size - MAX_ARG_PAGES*TARGET_PAGE_SIZE;
1022 1023
    p += stack_base;
1023 1024

  
b/linux-user/flatload.c
802 802
    info->end_data = libinfo[0].end_data;
803 803
    info->start_brk = libinfo[0].start_brk;
804 804
    info->start_stack = sp;
805
    info->stack_limit = libinfo[0].start_brk;
805 806
    info->entry = start_addr;
806 807
    info->code_offset = info->start_code;
807 808
    info->data_offset = info->start_data - libinfo[0].text_len;
b/linux-user/qemu.h
42 42
        abi_ulong       mmap;
43 43
        abi_ulong       rss;
44 44
        abi_ulong       start_stack;
45
        abi_ulong       stack_limit;
45 46
        abi_ulong       entry;
46 47
        abi_ulong       code_offset;
47 48
        abi_ulong       data_offset;
b/linux-user/syscall.c
5400 5400
        ret = get_errno(target_munmap(arg1, arg2));
5401 5401
        break;
5402 5402
    case TARGET_NR_mprotect:
5403
        {
5404
            TaskState *ts = ((CPUState *)cpu_env)->opaque;
5405
            /* Special hack to detect libc making the stack executable.  */
5406
            if ((arg3 & PROT_GROWSDOWN)
5407
                && arg1 >= ts->info->stack_limit
5408
                && arg1 <= ts->info->start_stack) {
5409
                arg3 &= ~PROT_GROWSDOWN;
5410
                arg2 = arg2 + arg1 - ts->info->stack_limit;
5411
                arg1 = ts->info->stack_limit;
5412
            }
5413
        }
5403 5414
        ret = get_errno(target_mprotect(arg1, arg2, arg3));
5404 5415
        break;
5405 5416
#ifdef TARGET_NR_mremap

Also available in: Unified diff