Subject: Branch relocation fixing at Kernel-compiling with Debian-toolchain

From: Achim Hensel <[email-masked]>
Date: Wed, 14 May 2003 12:31:44 +0200

Hello, folks 

[I try to build Linux for a R4k Indigo1. I'm using as and ld of the
debian-toolchain with mips-linux-as/mips-linux-ld 2.13.90.0.18
20030121. At the moment, the kernel just compiles, but is not bootable
due to further adaption.]

As I'm not much into MIPS or gas assembler (most experience with 6502),
I would like to have some hints how to work around some kernel-compiling
errors:

When compiling the linux-mips.org kernel from the CVS-MAIN branch,
compiling stopped, as expected at the two assembler files 
entry.S and scall_o32.S in linux/arch/mips/kernel/ (both recent
versions) with a BFD-RELOC_16_PCREL_S2. 

The fix of combining global/local label, mentioned in 
http://sources.redhat.com/ml/binutils/2003-02/msg00205.htm
and other places, got me around the problem. Not every branch needed the
fix. Just one error remains:

In entry.S rev 1.49, around line 63, the branch target label
resume_kernel is defined by either a line statement
(ENTRY(resume_kernel), l.79) or a #definition from an other label (l.
52), depending on some #Config-options.

As work around I hardwired the branch label to one of them.

Any hints to adapt the fix to this problem? 
Diff/Patch for the rest will be posted if requested.

[Now working on with ELF2ECOFF converting]

CU,
	Achim

---

From: Guido Guenther <[email-masked]>
Date: Wed, 14 May 2003 12:40:40 +0200

> due to further adaption.]
The simplest fix probably is to use 2.14.90.0.1. I have debs for mips
here if this is of any use.
 -- Guido

---

From: Robin Humble <[email-masked]>
Date: Wed, 14 May 2003 07:02:27 -0400

>[I try to build Linux for a R4k Indigo1. I'm using as and ld of the

Please let me know how you go with this... I'd like to try it too.
Are you compiling a generic r4k kernel? Is there much chipset
documentation available?

cheers,
robin

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 14 May 2003 20:00:34 +0200

> Are you compiling a generic r4k kernel? Is there much chipset

Little; however it's know that the machine is relativly similar to the
Indy for example so it seems doable for somebody with enough time.

  Ralf

---

From: Guido Guenther <[email-masked]>
Date: Wed, 14 May 2003 20:32:18 +0200

> Indy for example so it seems doable for somebody with enough time.
Maybe I'm stating the obvious but good look into Irix's /usr/include
helps a lot. It seems to have almost everything in it to get the Indigo
going (without serial consoel of course).
 -- Guido

---

From: Guido Guenther <[email-masked]>
Date: Wed, 14 May 2003 20:42:24 +0200

> going (without serial consoel of course).
_without_ fb and _with_ serial console only is what I wanted to say.
 -- Guido

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 14 May 2003 21:30:32 +0200

> _without_ fb and _with_ serial console only is what I wanted to say.

Thta still leaves alot of details open - but yes, it's certainly a step
into the right direction.  And there's always the hope once there is a
start somebody at SGI will throw real docs into our direction ...

  Ralf