Subject: Re: Shark boot image format
To: None <Richard.Earnshaw@buzzard.freeserve.co.uk>
From: Michael Dales <michael@dcs.gla.ac.uk>
List: port-arm32
Date: 07/20/2001 19:03:07
Richard Earnshaw <rearnsha@buzzard.freeserve.co.uk> writes:
> 
> It's probably your assembler linker that are causing the problems.  NetBSD 
> uses a specific magic number and the firmware may be expecting that.

Cheers.

First I tried just modifying the linker script from an ld set for
arm-aout-netbsd, and using it with my existing arm-aout tools, which
enabled the firmware to recognise the image, but it faulted
immediately on an unrecognised instruction. I assume then that it's
going to require something more, like actually building the full
arm-aout-netbsd tool chain. So...

I can make binutils for arm-aout-netbsd fine. My first attempt at
building gcc (configured with --without-headers and --with-newlib)
failed, as it was missing machine/ansi.h. A bit of searching the web
(google has been my friend today :) I discovered that, despite telling
it not to use headers, it still wants to find the system headers. So I
copied /usr/include from my shark onto my linux box and used
--with-headers to point it at where they were. 

This gets me further, and now I have the following problem:

_muldi3
_divdi3
/tmp/ccV83p3k.s: Assembler messages:
/tmp/ccV83p3k.s:346: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:350: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:368: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:372: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:394: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:431: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:435: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:452: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:456: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:479: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:483: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:501: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:505: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:572: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:576: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:594: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
/tmp/ccV83p3k.s:598: Error: Can not represent BFD_RELOC_ARM_PCREL_BRANCH relocation in this object file format
make[1]: *** [libgcc2.a] Error 1
make[1]: Leaving directory `/local/kettle_tmp0/michael/build-gcc/gcc'
make: *** [all-gcc] Error 2
bash$ 

It appears from this that the gcc I've built is generating arm26 code,
whilst binutils expects arm32 code (and given I'm targeting a
StrongARM, so do I!). I tried modifying the makefile to force the
compiler to generate 32 bit code (-by adding mapcs-32), but that
didn't seem to work either. 

Has anyone else tried to built the arm/netbsd tool chain as a cross
compiler? I'm using gcc-2.95.3. The same process worked fine for
arm-elf and arm-aout, it's just arm-aout-netbsd that I'm having a
problem with.

Cheers,

-- 
Michael Dales --- email: michael@dcs.gla.ac.uk --- tel: +44 141 330 6297
Department of Computing Science, University of Glasgow, Glasgow, G12 8QQ