Subject: Re: semi-random pmax file questions
To: Bill Studenmund <>
From: CyberPeasant <>
List: port-pmax
Date: 02/04/1998 21:22:32
> On Wed, 4 Feb 1998, Aaron J. Grier wrote:
> > 
> > $ cat hello.c
> > #include <stdio.h>
> > 
> > main() {
> >         printf("hello world!\n");
> > }
> > $ gcc hello.c -o hello
> > $ file hello
> > hello: ELF 32-bit LSB executable, MIPS R3000_BE - invalid byte order, version 1
> > $
> > 
> > Is this normal?  invalid byte order?
> I saw the same thing with a NetBSD ELF kernel. I'd love to have it
> explained.

And you'll find it with OpenBSD/pmax executables, too.  My impression
is that as far as file/magic is concerned, the message is correct.
It finds what it feels is the correct magic number for a BE ELF file,
but byte order is reversed.  What it should be finding (IMHO) is
the magic for a LE ELF, in the correct order.

Where the magic comes from I couldn't say. ld, no doubt.  The current
magic is a big-endian short 8, (0x08 0x00) whereas /etc/magic would like to 
see little-endian short 10. (0x00 0x0a)

I notice that older versions of /etc/magic (1.2.1) don't know about any
0x0a magic, and will say MIPS RS3000, for either big- or little-endian

Vi, of course, can solve all /etc/magic problems. ;)

> > I'm also having a heck of a time getting bash to run...  it compiles, but
> > upon execution bombs out with "free: Called with unallocated block
> > argument".  I know it's probably un-BSD of me, but I don't particularly
> > like csh syntax.  I WANT BASH.  :)
> I ran into something similar with tcsh, though the free didn't cause a
> crash. I think/bet the problem's that bash is defining its own malloc. Try
> either configuring it to use NetBSD's malloc, or compiling it staticly (so
> everything will use its malloc).

I'll second this suggestion. pdksh compiles pretty well, too.
I've been running bash under the, eh, other pmax BSD, and see no reason
why it shouldn't prosper under NetBSD. Statically linked, of course, although
I have run a dyn-linked version, too. (Using native libc malloc).

[root@flask /root]# bash --version
GNU bash, version 2.01.0(2)-release (mips-dec-openbsd2.1)
Copyright 1996 Free Software Foundation, Inc.
[root@flask /root]# 

PGP public key:  finger

       --== There are Greeks in that horse! I can hear them! ==--