Subject: origtest failure with MIPS-Linux glibc

From: Andreas Jaeger <[email-masked]>
Date: 30 Jun 2000 17:09:20 +0200

The current glibc testsuite contains in the elf subdirectory a test
called origtest which loads dynamically (via dlopen) the shared file
testobj1.so.

This test fails on MIPS-Linux since testobj1.so contains an undefined
reference to foo which can't be fulfilled.  

In elf_machine_runtime_setup (sysdeps/mips/dl-machine.h)
elf_machine_got_rel is called to relocate the GOT table.  The ABI
defines that "if an entry correspondends to an undefined symbol and
the global offset table entry contains a zero, the entry must be
resolved by the dynamic linker".  foo has a value of 0 and therefore we
need to relocate it (even if it is not called at all) - but there's no
reference at all:

Symbol table '.dynsym' contains 50 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
[...]
    48: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND foo

Who's to blame here?  Is this a restriction of the MIPS ELF ABI (I do
think that glibc's dynamic linker does the right think in this case)?
Or is there a bug in binutils/gcc which should produce a wrong symbol
entry?

Is there anything I can do to fix this failure?

Any comments are very welcome.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs [email-masked]
   private [email-masked]

---

From: Ulrich Drepper <[email-masked]>
Date: 30 Jun 2000 10:56:36 -0700

> reference to foo which can't be fulfilled.  

I thought we went over this alread.  There is a definition of `foo',
it is in origtest.c.  I MIPS has problems it's in not doing what
-rdynamic is expected to do.

$ nm elf/origtest|grep foo
08048680 T foo

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

---

From: Andreas Jaeger <[email-masked]>
Date: 30 Jun 2000 20:13:29 +0200

>>>>> Ulrich Drepper writes:

>> reference to foo which can't be fulfilled.  

Uli> I thought we went over this alread.  There is a definition of `foo',
We spoke about it - but didn't fix it.
Uli> it is in origtest.c.  I MIPS has problems it's in not doing what
Uli> -rdynamic is expected to do.

Uli> $ nm elf/origtest|grep foo
Uli> 08048680 T foo

But origtest doesn't have -rdynamic.  There's no
LDFLAGS-origtest = -rdynamic
in elf/Makefile.  Should it be there?

Andreas

---

From: Ulrich Drepper <[email-masked]>
Date: 30 Jun 2000 11:27:45 -0700

> in elf/Makefile.  Should it be there?

Look again :-)

---

From: Andreas Jaeger <[email-masked]>
Date: 30 Jun 2000 20:35:09 +0200

>> in elf/Makefile.  Should it be there?

Uli> Look again :-)

Thanks!

Andreas

---

From: Andreas Jaeger <[email-masked]>
Date: 30 Jun 2000 20:38:55 +0200

Uli> Look again :-)

One test failure less ;-).

Andreas