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
> 220.127.116.11.2 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 ld.so
expects. Other fixes might be needed for 2.10.1 to work at all -- they
are all available from:
ftp://ftp.ds2.pg.gda.pl/pub/macro/SRPMS/binutils-2.10.1-3.src.rpm (or use
a mirror at: ftp://ftp.rfc822.org/pub/mirror/ftp.ds2.pg.gda.pl/...).
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+ e-mail: email@example.com, 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