[Top] [All Lists]

Re: glibc 2.2 on MIPS

To: Christoph Martin <>
Subject: Re: glibc 2.2 on MIPS
From: "Maciej W. Rozycki" <>
Date: Thu, 4 Jan 2001 22:34:40 +0100 (MET)
Cc:,,,,, Andreas Jaeger <>
In-reply-to: <14932.57412.617757.439688@arthur.zdv.Uni-Mainz.DE>
Organization: Technical University of Gdansk
On Thu, 4 Jan 2001, Christoph Martin wrote:

> I just tried to build glibc-2.2 (CVS-2000-12-28) for debian-mips and
> it still has the "Bus Error" problem. We are currently using binutils
> and gcc 2.95.2 + CVS from 2.95 branch. 
> Can you please post both patches, so that we can verify which one is
> missing in our build.

 The 2.2 release of glibc needs no patches.  The current CVS version is
even better as a few unrelated fixes has been applied meanwhile.

 For binutils 2.10.1 the following fix makes binaries be built as
expects.  Other fixes might be needed for 2.10.1 to work at all -- they
are all available from: (or use
a mirror at:

+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+        e-mail:, PGP key available        +

diff -up --recursive --new-file binutils-2.10.macro/bfd/elf32-mips.c 
--- binutils-2.10.macro/bfd/elf32-mips.c        Sat Mar 11 02:23:10 2000
+++ binutils-2.10/bfd/elf32-mips.c      Sat Oct 28 17:19:52 2000
@@ -5675,15 +5675,16 @@ mips_elf_create_dynamic_relocation (outp
          /* The relocation we're building is section-relative.
             Therefore, the original addend must be adjusted by the
             section offset.  */
-         *addendp += symbol - sec->output_section->vma;
+         *addendp += section_offset;
          /* Now, the relocation is just against the section.  */
          symbol = sec->output_section->vma;
-      /* If the relocation was previously an absolute relocation, we
-        must adjust it by the value we give it in the dynamic symbol
-        table.  */
-      if (r_type != R_MIPS_REL32)
+      /* If the relocation was previously an absolute relocation and
+        this symbol will not be referred to by the relocation, we must
+        adjust it by the value we give it in the dynamic symbol table.
+        Otherwise leave the job up to the dynamic linker.  */
+      if (!indx && r_type != R_MIPS_REL32)
        *addendp += symbol;
       /* The relocation is always an REL32 relocation because we don't

<Prev in Thread] Current Thread [Next in Thread>