From: reig@dcs.gla.ac.uk
To: axp-list@redhat.com
Cc: glindahl@hpti.com
Subject: Re: 32-bit binaries (howto?)
Date: Thu, 14 Dec 2000 16:38:48 +0000 (GMT) [thread overview]
Message-ID: <200012141638.QAA27608@crab.dcs.gla.ac.uk> (raw)
In-Reply-To: <000401c065e8$c17bada0$e418fea9@hptilap.hpti.com> from "Greg Lindahl" at Dec 14, 2000 11:13:11 AM
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
next prev parent reply other threads:[~2000-12-14 16:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-29 16:49 32-bit binaries (howto?) reig
2000-11-29 17:00 ` Ron Farrer
2000-11-29 17:08 ` Ross A Knepper
2000-11-29 17:36 ` reig
2000-11-30 3:07 ` Greg Lindahl
2000-11-30 11:05 ` reig
2000-12-01 6:27 ` Greg Lindahl
2000-12-02 21:39 ` Ivan Kokshaysky
2000-12-14 12:56 ` reig
2000-12-14 16:13 ` Greg Lindahl
2000-12-14 16:38 ` reig [this message]
2000-11-30 3:05 ` Greg Lindahl
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox