Subject: Re: elf2bb is not sparc64 host compatible (yet)
To: None <port-amiga@netbsd.org>
From: Michael van Elst <mlelstv@serpens.de>
List: port-amiga
Date: 09/27/2004 22:32:31
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.
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.

-- 
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."