From owner-freebsd-current Fri Jul 2 22:55:17 1999 Delivered-To: freebsd-current@freebsd.org Received: from sturm.canonware.com (canonware.com [204.107.140.54]) by hub.freebsd.org (Postfix) with ESMTP id 7A66D15278 for ; Fri, 2 Jul 1999 22:55:14 -0700 (PDT) (envelope-from jasone@canonware.com) Received: from localhost (jasone@localhost) by sturm.canonware.com (8.8.8/8.8.8) with ESMTP id WAA29645 for ; Fri, 2 Jul 1999 22:55:12 -0700 (PDT) (envelope-from jasone@canonware.com) Date: Fri, 2 Jul 1999 22:55:12 -0700 (PDT) From: Jason Evans To: current@freebsd.org Subject: mmap(), MAP_STACK, and safe addresses Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I need a clue about process memory layout, and am hoping someone can provide it. I wrote a program to discover what address ranges mmap() can handle (trying to hack growable stacks into libc_r), and came up with the following output (annotations in `[]'): ---- FreeBSD donner 4.0-CURRENT FreeBSD 4.0-CURRENT #2: Fri Jul 2 19:25:07 PDT 1999 toor@donner:/usr/src/sys/compile/CUSTOM_donner i386 text data bss dec hex filename 2464 220 272 2956 b8c ./brute_stack initialized global: 0x08049a90 uninitialized global: 0x08049c74 main() function: 0x08048604 main() stack: ~0xbfbfd90c (grows down) stack size: 0x1000 bytes bad: 0x00000000 --> 0x00000fff, 0x00001000 bytes good: 0x00001000 --> 0x08047fff, 0x08047000 bytes [???] bad: 0x08048000 --> 0x280e3fff, 0x2009c000 bytes [text->data->bss->heap->] good: 0x280e4000 --> 0xbfbddfff, 0x97afa000 bytes [-><-] bad: 0xbfbde000 --> 0xffffffff, 0x40422000 bytes [<-stack, env] malloc()ed stack: 0x0804b000 ---- Some questions about the above: 1) What is the ??? range for? (The loader?) 2) Where exactly is the stack on the x86? 3) Where is the stack on the Alpha? 4) Where is the code that I should have read instead of bothering you? The rtld-elf code mentions the expectation that the "SVR4 ABI specification, Intel 386 Processor Supplement" is adhered to, but I couldn't find anything more specific. Thanks, Jason To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message