Subject: Problems with mips2 compiled libc and linux 2.4.3

From: Brian Murphy <[email-masked]>
Date: Mon, 18 Jun 2001 20:11:36 +0200

It seems that this check(in asm-mips/elf.h):

#define elf_check_arch(hdr)
\
({
\
        int __res = 1;
\
        struct elfhdr *__h = (hdr);
\

\
        if ((__h->e_machine != EM_MIPS) &&
\
            (__h->e_machine != EM_MIPS_RS4_BE))
\
                __res = 0;
\
        if (__h->e_flags & EF_MIPS_ARCH)
\
                __res = 0;
\

\
        __res;
\
})

which is called in fs/binfmt_elf.c causes the loading of init to fail if

it is linked with a glibc compiled with -mips2. It is the second if test

which fails if any of the high 4 bits in the flags are set. According to
the
specs these are set for the various mipsx (x != 1) flavors - this seems
to mean
that we do no allow anything higher than mips1 run on linux - can this
be
true? If so, why?

/Brian

---

From: "H . J . Lu" <[email-masked]>
Date: Mon, 18 Jun 2001 11:22:53 -0700

> it is linked with a glibc compiled with -mips2. It is the second if test

I patched my kernel to get around it.

> that we do no allow anything higher than mips1 run on linux - can this

There is no very good reason. I think we should add a MIPS ISA level
field in the mips cpuinfo so that we can check what ISA the hardware
support at the run-time.

H.J.

---

From: Ralf Baechle <[email-masked]>
Date: Mon, 18 Jun 2001 20:22:39 +0200

> the specs these are set for the various mipsx (x != 1) flavors - this seems
> to mean that we do no allow anything higher than mips1 run on linux -
> can this be
> true? If so, why?

Older binutils didn't use to set these flags but SGI's ld did so this was
a heuristc to reject IRIX binaries which are handled by irixelf.c.  The
fix is simple, just remove above test.

Time to come up with some other plan to detec IRIX binaries ...

  Ralf

---

From: Brian Murphy <[email-masked]>
Date: Mon, 18 Jun 2001 20:50:28 +0200

> >         if (__h->e_flags & EF_MIPS_ARCH)

Will this be removed from the cvs version then?

With all the talk of ll/sc and mips 1 and 2  in the last few months
how has anyone tested/run with a mips2 libc if this test existed in
their kernel?

/Brian

---

From: Ralf Baechle <[email-masked]>
Date: Mon, 18 Jun 2001 21:41:17 +0200

> field in the mips cpuinfo so that we can check what ISA the hardware

Yes and no.  It would be nice but the available flags are not an suitable
representation of processor capabilities.

  Ralf