Subject: Error: Branch out of range

From: Geert Uytterhoeven <[email-masked]>
Date: Wed, 15 Mar 2000 16:08:08 +0100 (MET)

I'm trying to compile lmbench on Linux/MIPS(EL). Gcc (egcs-2.90.27 980315
(egcs-1.0.2 release)) complains about

../bin/linux/lat_ctx.s: Assembler messages:
../bin/linux/lat_ctx.s:4293: Error: Branch out of range
../bin/linux/lat_ctx.s:40459: Error: Branch out of range

At line 4293 it jumps to line 40460 using `j', which is obviously further then
32K instructions apart (and incompatible with -KPIC, which is always[*] used).

How can I fix this?

Gr{oetje,eeting}s,

						Geert

[*] Why is MIPS code always compiled PIC?
--
Geert Uytterhoeven ------------- Sony Software Development Center Europe (SDCE)
[email-masked] ------------------- Sint-Stevens-Woluwestraat 55
Voice +32-2-7248638 Fax +32-2-7262686 ---------------- B-1130 Brussels, Belgium

---

From: Ralf Baechle <[email-masked]>
Date: Thu, 16 Mar 2000 11:29:10 -0300

> (egcs-1.0.2 release)) complains about

No, as from binutils (all versions) coplains.

> 32K instructions apart (and incompatible with -KPIC, which is always[*] used).

 - Fix the assembler.  Enjoy ...  lmbench is faik the only real world
   program which triggers this problem so I've never been very motivated to
   fix this ...
 - Get a newer version of lmbench which does no longer rely on such insane
   large loops.

> [*] Why is MIPS code always compiled PIC?

The calling convention for PIC code is to always have the address of the
callee in $25.  This implies that mixing PIC and non-PIC code is not
possible, therefore everything is PIC.

  Ralf