Subject: Re: elf2bb is not sparc64 host compatible (yet)
To: None <port-amiga@netbsd.org>
From: Gunther Nikl <gni@gecko.de>
List: port-amiga
Date: 09/28/2004 10:19:45
On Mon, Sep 27, 2004 at 10:32:31PM +0000, Michael van Elst wrote:
> gni@gecko.de (Gunther Nikl) writes:
> 
> >>   *((u_int32_t *)(base + htobe32(ra->r_offset))) =
> 
> >  Can you please explain why sparc64 doesn't like the original code?
> >  Its not obvious for me.
> 
> This is a cross build on sparc64 for m68k.
> Sparc64 and m68k don't have the same alignment rules.

  I was aware of the first point and wondered about the second ;)

> base is a malloc'd area that is aligned for all purposes.
> ra->r_offset is not necessariliy a multiple of 4.
> base + htobe32(ra->r_offset) is therefore not longword aligned.
> Writing to that address via a u_int32_t* on sparc64 causes a bus error.

  Ah, I see. Thats what I wanted to know. Sparc64 can only write a lw to
  a lw-aligned address?

  Gunther