Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Tru64 executeables
@ 1999-08-05  7:32 Bernhard Gschaider
  1999-08-05  7:58 ` Greg Lindahl
  1999-08-05  8:40 ` Angus Leeming
  0 siblings, 2 replies; 29+ messages in thread
From: Bernhard Gschaider @ 1999-08-05  7:32 UTC (permalink / raw)
  To: axp-list


If I remember it correctly (sorry I can't verify it because I can't
get to www.alphalinux.org right now) there is a way to make the
Tru64-Netscape-binary run on a Linux machine.

My question: is there a general way to make Tru64 binaries run under
Linux? The application I have in mind is a simulation program (just
numerics and file-i/o, no X-Windows).


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-05  7:32 Tru64 executeables Bernhard Gschaider
@ 1999-08-05  7:58 ` Greg Lindahl
  1999-08-05  8:05   ` John Connett
  1999-08-05  8:40 ` Angus Leeming
  1 sibling, 1 reply; 29+ messages in thread
From: Greg Lindahl @ 1999-08-05  7:58 UTC (permalink / raw)
  To: axp-list

> My question: is there a general way to make Tru64 binaries run under
> Linux? The application I have in mind is a simulation program (just
> numerics and file-i/o, no X-Windows).

Static link and go. However, if it's in Fortran, you can use the
native Linux Compaq Fortran compiler, which is in open beta-test.
C is going into beta-test soon.

-- g


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-05  7:58 ` Greg Lindahl
@ 1999-08-05  8:05   ` John Connett
  1999-08-05 13:01     ` Christopher C Chimelis
  0 siblings, 1 reply; 29+ messages in thread
From: John Connett @ 1999-08-05  8:05 UTC (permalink / raw)
  To: axp-list

Greg Lindahl wrote:
> Static link and go. However, if it's in Fortran, you can use the
> native Linux Compaq Fortran compiler, which is in open beta-test.
> C is going into beta-test soon.

Have you heard anything about when native Linux Compaq C++ might
appear?  I'm really keen to get hold of a copy ...

Regards
--
John Connett                        email: jrc@art-render.com
Systems Engineer                    voice: +44 1223 563854
Advanced Rendering Technology       fax:   +44 1223 516520
Cambridge, UK                       web:   http://www.art-render.com


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-05  7:32 Tru64 executeables Bernhard Gschaider
  1999-08-05  7:58 ` Greg Lindahl
@ 1999-08-05  8:40 ` Angus Leeming
  1999-08-05 11:03   ` Dave Mason
  1 sibling, 1 reply; 29+ messages in thread
From: Angus Leeming @ 1999-08-05  8:40 UTC (permalink / raw)
  To: axp-list

On Thu, 05 Aug 1999, Bernhard Gschaider wrote:
> If I remember it correctly (sorry I can't verify it because I can't
> get to www.alphalinux.org right now) there is a way to make the
> Tru64-Netscape-binary run on a Linux machine.
> 
> My question: is there a general way to make Tru64 binaries run under
> Linux? The application I have in mind is a simulation program (just
> numerics and file-i/o, no X-Windows).

If your code is static linked to any binaries then it will work straight off.

If it uses shared libraries, then you need to create directory /usr/shlib and
put all Tru64 shared libraries in there. You'll also need to install Tru64's
loader as /sbin/loader

Doing this I can run Netscape 4.08 quite happily under Linux/Alpha.

Angus


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-05  8:40 ` Angus Leeming
@ 1999-08-05 11:03   ` Dave Mason
  1999-08-05 11:29     ` Matti Aarnio
  1999-08-05 16:25     ` Greg Lindahl
  0 siblings, 2 replies; 29+ messages in thread
From: Dave Mason @ 1999-08-05 11:03 UTC (permalink / raw)
  To: Angus Leeming; +Cc: axp-list

>>>>> On Thu, 5 Aug 1999 09:40:34 +0100, Angus Leeming <a.leeming@ic.ac.uk> said:

> If it uses shared libraries, then you need to create directory
> /usr/shlib and put all Tru64 shared libraries in there. You'll also
> need to install Tru64's loader as /sbin/loader

To Compaq people:

Is there any chance that you would make an RPM that contained the
loader and the shared libraries from Tru64 so that we Linux folk can
legally run (at least Netscape) on AlphaLinux?  That seems like it
would be consistent with the current work to make the math library
available.

I'm not asking for the sources to the libraries, just the binaries.

I would think that other third party software suppliers would like to
see this done too, since it would increase their potential market
without any additional work on their part.  But all I immediately care
about is Netscape.

Thanks	../Dave


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-05 11:03   ` Dave Mason
@ 1999-08-05 11:29     ` Matti Aarnio
  1999-08-05 16:25     ` Greg Lindahl
  1 sibling, 0 replies; 29+ messages in thread
From: Matti Aarnio @ 1999-08-05 11:29 UTC (permalink / raw)
  To: axp-list; +Cc: Angus Leeming

(did I send this, or didn't I send this ?)

On Thu, Aug 05, 1999 at 07:03:26AM -0400, Dave Mason wrote:
> > /usr/shlib and put all Tru64 shared libraries in there. You'll also
> > need to install Tru64's loader as /sbin/loader
> 
> To Compaq people:

  (of which I am not..)

> Is there any chance that you would make an RPM that contained the
> loader and the shared libraries from Tru64 so that we Linux folk can
> legally run (at least Netscape) on AlphaLinux?  That seems like it
> would be consistent with the current work to make the math library
> available.
> 
> I'm not asking for the sources to the libraries, just the binaries.

  The FAQ answer is:  No.
  DEC (Q) has to pay royalties for each copy of the library to OSF.
  So, no.

  There would be no problem if the entire libc were DEC code, like
  the math-lib is.

> I would think that other third party software suppliers would like to
> see this done too, since it would increase their potential market
> without any additional work on their part.  But all I immediately care
> about is Netscape.

  Getting Tru64 to run (Linux) ELF, and getting glibc based library
  there against which e.g. Netscape ( + X11 + Motif ) is then linked
  would solve the whole problem, right ?

> Thanks	../Dave

/Matti Aarnio <matti.aarnio@sonera.fi>


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-05  8:05   ` John Connett
@ 1999-08-05 13:01     ` Christopher C Chimelis
  0 siblings, 0 replies; 29+ messages in thread
From: Christopher C Chimelis @ 1999-08-05 13:01 UTC (permalink / raw)
  To: axp-list


On Thu, 5 Aug 1999, John Connett wrote:

> Have you heard anything about when native Linux Compaq C++ might
> appear?  I'm really keen to get hold of a copy ...

From what I hear, it won't be until after next month.  The C compiler is
next, followed by C++.  There's no definite release date for the beta
that's been told to anyone outside of Compaq (from what I know).

C


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-05 11:03   ` Dave Mason
  1999-08-05 11:29     ` Matti Aarnio
@ 1999-08-05 16:25     ` Greg Lindahl
  1999-08-06  8:46       ` Ivan Kokshaysky
  1 sibling, 1 reply; 29+ messages in thread
From: Greg Lindahl @ 1999-08-05 16:25 UTC (permalink / raw)
  To: axp-list

> Is there any chance that you would make an RPM that contained the
> loader and the shared libraries from Tru64 so that we Linux folk can
> legally run (at least Netscape) on AlphaLinux?  That seems like it
> would be consistent with the current work to make the math library
> available.

What we really need is the -taso flag added to GNU ld. This flag links
a process so that it runs in a 32-bit address space (e.g. it places
everything so that the upper 32 bits of all addresses is zero). Minor
kernel changes are also needed. That would allow Netscape and a
variety of other broken programs to be easily compiled in AlphaLinux.

-- g


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-05 16:25     ` Greg Lindahl
@ 1999-08-06  8:46       ` Ivan Kokshaysky
  1999-08-06 10:52         ` Roman Martonak
                           ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: Ivan Kokshaysky @ 1999-08-06  8:46 UTC (permalink / raw)
  To: axp-list

On Thu, Aug 05, 1999 at 12:25:13PM -0400, Greg Lindahl wrote:
> What we really need is the -taso flag added to GNU ld. This flag links
> a process so that it runs in a 32-bit address space (e.g. it places
> everything so that the upper 32 bits of all addresses is zero). Minor
> kernel changes are also needed. That would allow Netscape and a
> variety of other broken programs to be easily compiled in AlphaLinux.
> 

Actually, it's possible right now. Create linker script with
`ld --verbose', edit it like this
-  . = 0x120000000 + SIZEOF_HEADERS;
+  . = 0x10000 + SIZEOF_HEADERS;
and link with it. Then you have to set 1 (EF_ALPHA_32BIT)
at file offset 0x30 (Elf64_Ehdr.e_flags) in the executable.
Any 2.2.x kernel supports this flag.

(Thanks to Richard Henderson who pointed that out at the gcc list)

Ivan.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-06  8:46       ` Ivan Kokshaysky
@ 1999-08-06 10:52         ` Roman Martonak
  1999-08-06 18:22         ` Greg Lindahl
  1999-08-06 23:13         ` Greg Lindahl
  2 siblings, 0 replies; 29+ messages in thread
From: Roman Martonak @ 1999-08-06 10:52 UTC (permalink / raw)
  To: axp-list

Ivan Kokshaysky writes:

 > 
 > Actually, it's possible right now. Create linker script with
 > `ld --verbose', edit it like this
 > -  . = 0x120000000 + SIZEOF_HEADERS;
 > +  . = 0x10000 + SIZEOF_HEADERS;
 > and link with it. Then you have to set 1 (EF_ALPHA_32BIT)
 > at file offset 0x30 (Elf64_Ehdr.e_flags) in the executable.
 > Any 2.2.x kernel supports this flag.
 > 
 > (Thanks to Richard Henderson who pointed that out at the gcc list)
 > 
 > Ivan.

So is this likely to be the final solution for Netscape on Alphalinux ?

-- 
Dr. Roman Martonak
Max-Planck-Institut fuer Festkoerperforschung         Phone: +49 +711 6891756
Heisenbergstrasse 1				      Fax:   +49 +711 6891702 
D-70569 Stuttgart	                http://parrserv2.mpi-stuttgart.mpg.de
Germany		                     mailto:martonak@prr.mpi-stuttgart.mpg.de


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-06  8:46       ` Ivan Kokshaysky
  1999-08-06 10:52         ` Roman Martonak
@ 1999-08-06 18:22         ` Greg Lindahl
  1999-08-06 19:36           ` Jim Gettys
  1999-08-06 23:13         ` Greg Lindahl
  2 siblings, 1 reply; 29+ messages in thread
From: Greg Lindahl @ 1999-08-06 18:22 UTC (permalink / raw)
  To: axp-list

> Actually, it's possible right now. Create linker script with
> `ld --verbose', edit it like this
> -  . = 0x120000000 + SIZEOF_HEADERS;
> +  . = 0x10000 + SIZEOF_HEADERS;
> and link with it. Then you have to set 1 (EF_ALPHA_32BIT)
> at file offset 0x30 (Elf64_Ehdr.e_flags) in the executable.
> Any 2.2.x kernel supports this flag.
> 
> (Thanks to Richard Henderson who pointed that out at the gcc list)

This is great news! Can we:

1) Get this into the FAQ
2) Have someone write a script to make this easy to use
3) Test it some
4) Get someone at Netscape to build us a Netscape binary?

-- g


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-06 18:22         ` Greg Lindahl
@ 1999-08-06 19:36           ` Jim Gettys
  1999-08-06 20:31             ` Jim Gettys
  0 siblings, 1 reply; 29+ messages in thread
From: Jim Gettys @ 1999-08-06 19:36 UTC (permalink / raw)
  To: axp-list; +Cc: Greg Lindahl


> From: Greg Lindahl <lindahl@cs.virginia.edu>
> Resent-From: axp-list@redhat.com
> Date: Fri, 6 Aug 1999 14:22:11 -0400 (EDT)
> To: axp-list@redhat.com
> Subject: Re: Tru64 executeables
> -----
> > Actually, it's possible right now. Create linker script with
> > `ld --verbose', edit it like this
> > -  . = 0x120000000 + SIZEOF_HEADERS;
> > +  . = 0x10000 + SIZEOF_HEADERS;
> > and link with it. Then you have to set 1 (EF_ALPHA_32BIT)
> > at file offset 0x30 (Elf64_Ehdr.e_flags) in the executable.
> > Any 2.2.x kernel supports this flag.
> >
> > (Thanks to Richard Henderson who pointed that out at the gcc list)
> 
> This is great news! Can we:
> 
> 1) Get this into the FAQ
> 2) Have someone write a script to make this easy to use
> 3) Test it some
> 4) Get someone at Netscape to build us a Netscape binary?
> 

Have you ever tried to build Netscape 4.X on a new platform?  (or even an old
one?).  Monumental pain...

Feel free to ask, but I'd guess you'll be told: help with the
mozilla effort on alpha Linux (btw, various mozilla versions do in fact
run on Alpha Linux, last I checked)...  Mozilla is at least something
mere mortals can deal with, from what I've seen (I've tried both early
mozilla bits, which were mostly Netscape 4.x bits, and later mozilla bits,
with new toolkit and build stuff in it, and it is night and day; they've
gone from essentially unbuildable unless you are a fulltime Netscape 
employee to something mere mortals have a chance of building and getting
running).

This is where work should go in my humble opinion, as we have other ways
of running the DU netscape on Alpha Linux already.  (and yes, there is
one person in Compaq who has already been working on mozilla on alpha linux:
but more help and testers are clearly a good idea).

This is not to say that -taso isn't useful: would be nice to get ld to
do it without such obscure scripts for other apps, but mozilla isn't one
of those apps which need it....

					- Jim Gettys


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-06 19:36           ` Jim Gettys
@ 1999-08-06 20:31             ` Jim Gettys
  0 siblings, 0 replies; 29+ messages in thread
From: Jim Gettys @ 1999-08-06 20:31 UTC (permalink / raw)
  To: axp-list; +Cc: Greg Lindahl

To make myself clear:


> From: jg@pa.dec.com (Jim Gettys)
> Resent-From: axp-list@redhat.com
> Date: Fri, 6 Aug 1999 12:36:43 -0700
> To: axp-list@redhat.com
> Cc: Greg Lindahl <lindahl@cs.virginia.edu>
> Subject: Re: Tru64 executeables
> -----
> > From: Greg Lindahl <lindahl@cs.virginia.edu>
> > Resent-From: axp-list@redhat.com
> > Date: Fri, 6 Aug 1999 14:22:11 -0400 (EDT)
> > To: axp-list@redhat.com
> > Subject: Re: Tru64 executeables
> > -----
> > > Actually, it's possible right now. Create linker script with
> > > `ld --verbose', edit it like this
> > > -  . = 0x120000000 + SIZEOF_HEADERS;
> > > +  . = 0x10000 + SIZEOF_HEADERS;
> > > and link with it. Then you have to set 1 (EF_ALPHA_32BIT)
> > > at file offset 0x30 (Elf64_Ehdr.e_flags) in the executable.
> > > Any 2.2.x kernel supports this flag.
> > >
> > > (Thanks to Richard Henderson who pointed that out at the gcc list)
> >
> > This is great news! Can we:
> >
> > 1) Get this into the FAQ

I think this is a great idea...

> > 2) Have someone write a script to make this easy to use

Sounds fine to me...  Even better, get ld to do it as a command line
switch...

> > 3) Test it some

Also sounds fine....

> > 4) Get someone at Netscape to build us a Netscape binary?
> >

At this date, this is the one point I'm objecting to, while urging
people to help with mozilla on Alpha linux.

If you had trouble trying to build mozilla a year ago (as I did),
it is time to try again: it seems possible by mere mortals, which
it wasn't a year ago.

> 
> Have you ever tried to build Netscape 4.X on a new platform?  (or even an old
> one?).  Monumental pain...
> 
> Feel free to ask, but I'd guess you'll be told: help with the
> mozilla effort on alpha Linux (btw, various mozilla versions do in fact
> run on Alpha Linux, last I checked)...  Mozilla is at least something
> mere mortals can deal with, from what I've seen (I've tried both early
> mozilla bits, which were mostly Netscape 4.x bits, and later mozilla bits,
> with new toolkit and build stuff in it, and it is night and day; they've
> gone from essentially unbuildable unless you are a fulltime Netscape
> employee to something mere mortals have a chance of building and getting
> running).
> 
> This is where work should go in my humble opinion, as we have other ways
> of running the DU netscape on Alpha Linux already.  (and yes, there is
> one person in Compaq who has already been working on mozilla on alpha linux:
> but more help and testers are clearly a good idea).
> 
> This is not to say that -taso isn't useful: would be nice to get ld to
> do it without such obscure scripts for other apps, but mozilla isn't one
> of those apps which need it....
> 
>                                         - Jim Gettys
> 
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-06  8:46       ` Ivan Kokshaysky
  1999-08-06 10:52         ` Roman Martonak
  1999-08-06 18:22         ` Greg Lindahl
@ 1999-08-06 23:13         ` Greg Lindahl
  1999-08-07  1:28           ` Richard Henderson
  1999-08-07  2:53           ` Greg Lindahl
  2 siblings, 2 replies; 29+ messages in thread
From: Greg Lindahl @ 1999-08-06 23:13 UTC (permalink / raw)
  To: axp-list

> Actually, it's possible right now. Create linker script with
> `ld --verbose', edit it like this
> -  . = 0x120000000 + SIZEOF_HEADERS;
> +  . = 0x10000 + SIZEOF_HEADERS;
> and link with it. Then you have to set 1 (EF_ALPHA_32BIT)
> at file offset 0x30 (Elf64_Ehdr.e_flags) in the executable.
> Any 2.2.x kernel supports this flag.

OK, so you need to:

ld --verbose > script
delete up to the "============" and the one at the end
make the above change
ld -T script -static
flip the bit at 0x30

My grungy fortran program now quietly exits, but it _was_ segfaulting... so
maybe this does work.

-- g


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-06 23:13         ` Greg Lindahl
@ 1999-08-07  1:28           ` Richard Henderson
  1999-08-07  1:30             ` Greg Lindahl
  1999-08-07  2:53           ` Greg Lindahl
  1 sibling, 1 reply; 29+ messages in thread
From: Richard Henderson @ 1999-08-07  1:28 UTC (permalink / raw)
  To: axp-list

On Fri, Aug 06, 1999 at 07:13:59PM -0400, Greg Lindahl wrote:
> ld -T script -static

You don't have to make it static if you don't want.

> flip the bit at 0x30

This bit means you won't get anything mapped at addresses above
0x7fffffff without explicitly requesting it (via mmap MAP_FIXED).

The upshot of this is that the shared libraries and the brk
arena wind up in the low 31 bits, which means you can cast 
pointers through int and back without damage.


r~


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-07  1:28           ` Richard Henderson
@ 1999-08-07  1:30             ` Greg Lindahl
  0 siblings, 0 replies; 29+ messages in thread
From: Greg Lindahl @ 1999-08-07  1:30 UTC (permalink / raw)
  To: axp-list

> > ld -T script -static
> 
> You don't have to make it static if you don't want.

Well, I got an ugly error message without making it static...

> The upshot of this is that the shared libraries and the brk
> arena wind up in the low 31 bits, which means you can cast 
> pointers through int and back without damage.

Yes. That's what this e-vile program is doing. It's a fairly common
bit of brain damage in old F77 programs that do dynamic memory.

-- g


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-06 23:13         ` Greg Lindahl
  1999-08-07  1:28           ` Richard Henderson
@ 1999-08-07  2:53           ` Greg Lindahl
  1999-08-07  4:07             ` Pointer problems Tommy Cheung
  1999-08-07  6:54             ` Tru64 executeables Ivan Kokshaysky
  1 sibling, 2 replies; 29+ messages in thread
From: Greg Lindahl @ 1999-08-07  2:53 UTC (permalink / raw)
  To: axp-list

> > Then you have to set 1 (EF_ALPHA_32BIT)
> > at file offset 0x30 (Elf64_Ehdr.e_flags) in the executable.
> > Any 2.2.x kernel supports this flag.

Actually, by looking at the return value from malloc(), it's clear
that I am not doing this step properly. Is this the 48th byte from the
start of the file?

-- greg


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Pointer problems
  1999-08-07  2:53           ` Greg Lindahl
@ 1999-08-07  4:07             ` Tommy Cheung
  1999-08-07  5:30               ` Michal Jaegermann
  1999-08-07  6:54             ` Tru64 executeables Ivan Kokshaysky
  1 sibling, 1 reply; 29+ messages in thread
From: Tommy Cheung @ 1999-08-07  4:07 UTC (permalink / raw)
  To: axp-list

Hi all,

I think this might be a common problem with programs between 32bit and
64bit.

        machine = (char *)malloc(MAXLINE);
        strncpy(machine, arg, MAXLINE - 1);

        if (strncmp(machine, "http://", 7) == 0) {
                http = 1;
                debug("We have an http request\n");
                machine += 7;
                port = 80;      /* STANDARD HTTP PORT */
        }
        else {
                http=0;         /* NOT TESTING HTTP */
                port = 23;      /* TELNET DEFAULT */
        }

        ptr = (char *)strchr(machine, ':');

when complie we got this

bbnet.c:93: warning: cast to pointer from integer of different size

Any ideas?

Tommy



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Pointer problems
  1999-08-07  4:07             ` Pointer problems Tommy Cheung
@ 1999-08-07  5:30               ` Michal Jaegermann
  0 siblings, 0 replies; 29+ messages in thread
From: Michal Jaegermann @ 1999-08-07  5:30 UTC (permalink / raw)
  To: axp-list

Tommy Cheung wrote:
> 
> I think this might be a common problem with programs between 32bit and
> 64bit.

Not really - with a minimum care.

....
> 
>         ptr = (char *)strchr(machine, ':');
> 
> when complie we got this
> 
> bbnet.c:93: warning: cast to pointer from integer of different size

You do not really say which line is 93 but from the context, most
likely, you forgot to include headers with declarations of functions
like malloc(), strchr() and the like.  If a declaration is missing
then C, by default, assumes that such function returns 'int' and you
really wanted a pointer here.  You see more such code and you start
understand those who claim that any explicit casts are evil.

Note that the code was incorrect in a 32-bit case as well even if
happened to work there due to lucky circumstances.

> Any ideas?

Compiling, especially on Alpha, without -Wall at miminum (there are
warnings not covered by "all") is a very unwise practice.  You would
be clearly told what was missing otherwise.

A common real problem are assumptions that you may store pointer
into 'int' and later recover from there the whole address intact.
This may be not so easy to fix in a bigger code because of a network
of interdependencies.  Also passing a pointer to function where
int was expected, or vice-versa, and a prototype is missing leads to
a "barrel-of-laugh" problems with a stack totally wacko.  You will
be likely hit not immediately where the bug is but quite a bit later
and results can be anything.

   Michal


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-07  2:53           ` Greg Lindahl
  1999-08-07  4:07             ` Pointer problems Tommy Cheung
@ 1999-08-07  6:54             ` Ivan Kokshaysky
  1999-08-07  7:04               ` Greg Lindahl
  1999-08-09 13:01               ` Phil Carmody
  1 sibling, 2 replies; 29+ messages in thread
From: Ivan Kokshaysky @ 1999-08-07  6:54 UTC (permalink / raw)
  To: axp-list

On Fri, Aug 06, 1999 at 10:53:19PM -0400, Greg Lindahl wrote:
> Actually, by looking at the return value from malloc(), it's clear
> that I am not doing this step properly. Is this the 48th byte from the
> start of the file?
 
Yes, 48th byte, bit 0 set to 1.

Ivan.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-07  6:54             ` Tru64 executeables Ivan Kokshaysky
@ 1999-08-07  7:04               ` Greg Lindahl
  1999-08-07 21:29                 ` Richard Henderson
  1999-08-09 13:01               ` Phil Carmody
  1 sibling, 1 reply; 29+ messages in thread
From: Greg Lindahl @ 1999-08-07  7:04 UTC (permalink / raw)
  To: axp-list

> Yes, 48th byte, bit 0 set to 1.

Well, I did that, but it still gives > 2GB return values. I even
edited /usr/share/magic to confirm that I was setting the right bit.
2.2.5-16 kernel, which means it's the source shipped with RH 6.0.

I suppose I could decode the other Elf header values to make sure it's
even trying to place things low...

-- g


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-07  7:04               ` Greg Lindahl
@ 1999-08-07 21:29                 ` Richard Henderson
  1999-08-07 21:52                   ` Dave Mason
  1999-08-07 22:27                   ` Greg Lindahl
  0 siblings, 2 replies; 29+ messages in thread
From: Richard Henderson @ 1999-08-07 21:29 UTC (permalink / raw)
  To: axp-list; +Cc: libc-hacker

On Sat, Aug 07, 1999 at 03:04:56AM -0400, Greg Lindahl wrote:
> Well, I did that, but it still gives > 2GB return values. I even
> edited /usr/share/magic to confirm that I was setting the right bit.
> 2.2.5-16 kernel, which means it's the source shipped with RH 6.0.

Bugger it all for a lark.  Glibc is being "helpful":

execve("./a.out", ["./a.out"], [/* 24 vars */]) = 0
brk(0)                                  = 0x120100c20
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 4
fstat(4, {st_mode=01, st_size=934060944, ...}) = 0
mmap(0, 2147480832, PROT_READ, 0 /* MAP_??? */, 0, 0) = 0x40010000
close(4)                                = 0
open("/lib/libc.so.6.1", O_RDONLY)      = 4
mmap(0, 0, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x40014000
munmap(0x40014000, 8192)                = 0
mmap(0, 8192, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x40110000
mprotect(0x401d8000, 1153256, PROT_NONE) = 0
mmap(0x402d0000, 1153256, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x402d0000
mmap(0x402e8000, 1153256, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x402e8000
close(4)                                = 0
munmap(0x40010000, 14596)               = 0
personality(PER_LINUX)                  = 8388608

Whee.  We've just reset 32bit mode.

In the meantime, drop `personality(0x800000)' somewhere
near the beginning of main.



r~


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-07 21:29                 ` Richard Henderson
@ 1999-08-07 21:52                   ` Dave Mason
  1999-08-07 22:03                     ` Greg Lindahl
  1999-08-07 22:27                   ` Greg Lindahl
  1 sibling, 1 reply; 29+ messages in thread
From: Dave Mason @ 1999-08-07 21:52 UTC (permalink / raw)
  To: axp-list; +Cc: libc-hacker

>>>>> On Sat, 7 Aug 1999 14:29:10 -0700, Richard Henderson <rth@twiddle.net> said:

> personality(PER_LINUX) = 8388608

( = 0x0800000)

> Whee.  We've just reset 32bit mode.

> In the meantime, drop `personality(0x800000)' somewhere near the
> beginning of main.

Actually, from /usr/include/linux/personality.h:
	/* Flags for bug emulation. These occupy the top three bytes. */
	#define STICKY_TIMEOUTS		0x4000000
	#define WHOLE_SECONDS		0x2000000
	#define ADDR_MAX_32BIT		0x1000000
	#define ADDR_MAX_31BIT		0x0800000

so, that bit seems to be 31bit mode.  But it makes sense to set it
back to what it was.

../Dave


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-07 21:52                   ` Dave Mason
@ 1999-08-07 22:03                     ` Greg Lindahl
  0 siblings, 0 replies; 29+ messages in thread
From: Greg Lindahl @ 1999-08-07 22:03 UTC (permalink / raw)
  To: axp-list

> Actually, from /usr/include/linux/personality.h:
> 	/* Flags for bug emulation. These occupy the top three bytes. */
> 	#define STICKY_TIMEOUTS		0x4000000
> 	#define WHOLE_SECONDS		0x2000000
> 	#define ADDR_MAX_32BIT		0x1000000
> 	#define ADDR_MAX_31BIT		0x0800000

Obviously this file has changed recently -- in 2.2.3, there was only
ADDR_MAX_32BIT, and it was 0x0800000.

-- g


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-07 21:29                 ` Richard Henderson
  1999-08-07 21:52                   ` Dave Mason
@ 1999-08-07 22:27                   ` Greg Lindahl
  1 sibling, 0 replies; 29+ messages in thread
From: Greg Lindahl @ 1999-08-07 22:27 UTC (permalink / raw)
  To: axp-list

> Whee.  We've just reset 32bit mode.
> 
> In the meantime, drop `personality(0x800000)' somewhere
> near the beginning of main.

Yep, that did the trick. I went from dying with segfaults to dying
with an FPE! Progress! Yes!

-- g


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-07  6:54             ` Tru64 executeables Ivan Kokshaysky
  1999-08-07  7:04               ` Greg Lindahl
@ 1999-08-09 13:01               ` Phil Carmody
  1999-08-09 17:02                 ` Greg Lindahl
  1999-08-09 17:22                 ` Ivan Kokshaysky
  1 sibling, 2 replies; 29+ messages in thread
From: Phil Carmody @ 1999-08-09 13:01 UTC (permalink / raw)
  To: axp-list

On Sat, 7 Aug 1999, EXT Ivan Kokshaysky wrote:

> On Fri, Aug 06, 1999 at 10:53:19PM -0400, Greg Lindahl wrote:
> > Actually, by looking at the return value from malloc(), it's clear
> > that I am not doing this step properly. Is this the 48th byte from the
> > start of the file?
>  
> Yes, 48th byte, bit 0 set to 1.

Just to clear any ambiguity, is the first byte byte zero or byte one? 

e.g.
$ od -x .emacs
0000000 3b3b 2045 6d61 6373 2031 3920 7665 7273
0000020 696f 6e2d 7370 6563 6966 6963 2073 7461
                            ^^
                            this is position 48
                            but is the 49th byte

Phil

-- 
Phil Carmody.
Not speaking for or on behalf of Nokia Telecommunications

If triangles made a god, they would give him three sides.
-- Charles de Montesquieu (1689-1755) Lettres Persanes, letter 59 (1721).


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-09 13:01               ` Phil Carmody
@ 1999-08-09 17:02                 ` Greg Lindahl
  1999-08-09 17:22                 ` Ivan Kokshaysky
  1 sibling, 0 replies; 29+ messages in thread
From: Greg Lindahl @ 1999-08-09 17:02 UTC (permalink / raw)
  To: axp-list

> > Yes, 48th byte, bit 0 set to 1.
> 
> Just to clear any ambiguity, is the first byte byte zero or byte one? 

The first byte is zero. However, it doesn't matter; you have to call
personality() in your program in order to dodge glibc()'s helpful
unsetting the 32-bit personality.

-- g


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-09 13:01               ` Phil Carmody
  1999-08-09 17:02                 ` Greg Lindahl
@ 1999-08-09 17:22                 ` Ivan Kokshaysky
  1999-08-09 17:27                   ` Phil Carmody
  1 sibling, 1 reply; 29+ messages in thread
From: Ivan Kokshaysky @ 1999-08-09 17:22 UTC (permalink / raw)
  To: axp-list

On Mon, Aug 09, 1999 at 02:01:47PM +0100, Phil Carmody wrote:
> Just to clear any ambiguity, is the first byte byte zero or byte one? 
> 
First byte is a byte [with address] zero.

> e.g.
> $ od -x .emacs
> 0000000 3b3b 2045 6d61 6373 2031 3920 7665 7273
> 0000020 696f 6e2d 7370 6563 6966 6963 2073 7461
>                             ^^
>                             this is position 48
>                             but is the 49th byte
> 

Nope, this is position 41 (0x29) ;-)

Ivan.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Tru64 executeables
  1999-08-09 17:22                 ` Ivan Kokshaysky
@ 1999-08-09 17:27                   ` Phil Carmody
  0 siblings, 0 replies; 29+ messages in thread
From: Phil Carmody @ 1999-08-09 17:27 UTC (permalink / raw)
  To: axp-list

Bugger, in trying to disambiguate a possible misunderstanding I ended up
confusing the issue. I'm sorry!

> > $ od -x .emacs
> > 0000000 3b3b 2045 6d61 6373 2031 3920 7665 7273
> > 0000020 696f 6e2d 7370 6563 6966 6963 2073 7461
    ^^^^^^^ in octal - grrr!!

D'Oh!

 
-- 
Phil Carmody.
Not speaking for or on behalf of Nokia Telecommunications

Anyway the :// part is an 'emoticon' representing a man with a 
strip of sticky tape across his mouth. -- R. Douglas 


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~1999-08-09 17:27 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-08-05  7:32 Tru64 executeables Bernhard Gschaider
1999-08-05  7:58 ` Greg Lindahl
1999-08-05  8:05   ` John Connett
1999-08-05 13:01     ` Christopher C Chimelis
1999-08-05  8:40 ` Angus Leeming
1999-08-05 11:03   ` Dave Mason
1999-08-05 11:29     ` Matti Aarnio
1999-08-05 16:25     ` Greg Lindahl
1999-08-06  8:46       ` Ivan Kokshaysky
1999-08-06 10:52         ` Roman Martonak
1999-08-06 18:22         ` Greg Lindahl
1999-08-06 19:36           ` Jim Gettys
1999-08-06 20:31             ` Jim Gettys
1999-08-06 23:13         ` Greg Lindahl
1999-08-07  1:28           ` Richard Henderson
1999-08-07  1:30             ` Greg Lindahl
1999-08-07  2:53           ` Greg Lindahl
1999-08-07  4:07             ` Pointer problems Tommy Cheung
1999-08-07  5:30               ` Michal Jaegermann
1999-08-07  6:54             ` Tru64 executeables Ivan Kokshaysky
1999-08-07  7:04               ` Greg Lindahl
1999-08-07 21:29                 ` Richard Henderson
1999-08-07 21:52                   ` Dave Mason
1999-08-07 22:03                     ` Greg Lindahl
1999-08-07 22:27                   ` Greg Lindahl
1999-08-09 13:01               ` Phil Carmody
1999-08-09 17:02                 ` Greg Lindahl
1999-08-09 17:22                 ` Ivan Kokshaysky
1999-08-09 17:27                   ` Phil Carmody

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox