From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id EF0BE2F05F for ; Thu, 14 Dec 2000 11:38:53 -0500 (EST) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id eBEGcrr08256 for axp-list@listman.redhat.com; Thu, 14 Dec 2000 11:38:53 -0500 Received: from iona.dcs.gla.ac.uk (iona.dcs.gla.ac.uk [130.209.240.35]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id eBEGcrD08252 for ; Thu, 14 Dec 2000 11:38:53 -0500 Received: from crab.dcs.gla.ac.uk ([130.209.241.150]) by iona.dcs.gla.ac.uk with esmtp (Exim 3.13 #1) id 146bPA-0006UY-00; Thu, 14 Dec 2000 16:38:52 +0000 Received: by crab.dcs.gla.ac.uk (8.8.8+Sun/Dumb) id QAA27608; Thu, 14 Dec 2000 16:38:48 GMT From: reig@dcs.gla.ac.uk Message-Id: <200012141638.QAA27608@crab.dcs.gla.ac.uk> Subject: Re: 32-bit binaries (howto?) To: axp-list@redhat.com Date: Thu, 14 Dec 2000 16:38:48 +0000 (GMT) Cc: glindahl@hpti.com In-Reply-To: <000401c065e8$c17bada0$e418fea9@hptilap.hpti.com> from "Greg Lindahl" at Dec 14, 2000 11:13:11 AM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors Greg Lindahl wrote: > > > OK, I've linked my program with gcc -Wl,-taso ... and yet I'm seeing > > addresses larger than 2^32 with gdb: > > Are you running a version of glibc recent enough to not stomp on your 32-bit > configuration? The previous messages that you were quoting a while back > explains how to use strace to look for this problem, and what call to add to > your program to fix it, at startup. I now have more information about the possible cause of this. The program uses mmap, and I need to make sure that mmap only allocates in the low 32-bits of the address space. I have the following #ifdef for Alpha/osf1. [The calls will be like mmap(MMAP_ADDR, ......)] #if (defined(HOST_ALPHA32) && (defined(OPSYS_OSF1) || defined(OPSYS_DUNIX))) /* To insure that mmap returns a 32-bit address, we need to specify a non-zero address to mmap(). The address 0x2000000 is the location of the text segment, which is a good minimum value since the C stack lives just below this address and mmap will find regions above it. */ # define MMAP_ADDR (caddr_t)0x2000000 #else # define MMAP_ADDR 0 #endif [We are passing -T 2000000 to cc on alpha osf1/dunix] If I tentatively use the same value for alpha linux, I do not core dump at the same point I did a few hours ago (I get other problems unrelated to this). However, does anyone know of a sensible address for the first argument of mmap on alpha linux if I want to allocate in the lower 32 bits? That is, what is the default memory layout (text, stack, etc)? Thanks in advance Fermin