[OpenBIOS] [PATCH] forthstrap: avoid unaligned accesses
Aurelien Jarno
aurelien at aurel32.net
Sun Dec 8 13:26:17 CET 2013
On Sun, Dec 08, 2013 at 11:51:13AM +0000, Mark Cave-Ayland wrote:
> On 08/12/13 10:53, Aurelien Jarno wrote:
>
> >Trying to compile OpenBIOS for SPARC32 on a SPARC machine, I get a
> >SIGBUS within forthstrap, more precisely accessing reloc_table in
> >load_dictionary. This table is not aligned because the dictionnary
> >head as a size which is not a multiple of 4.
> >
> >This is due to the file QEMU,tcx.bin which is being encoded, and which
> >has a size which is not a multiple of 4. Fix that by adding some padding
> >after the encoded data.
> >---
> > kernel/bootstrap.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> >diff --git a/kernel/bootstrap.c b/kernel/bootstrap.c
> >index 546ffee..7f4458e 100644
> >--- a/kernel/bootstrap.c
> >+++ b/kernel/bootstrap.c
> >@@ -1008,6 +1008,7 @@ encode_file( const char *name )
> > PUSH( pointer2cell(dict + dicthead) );
> > PUSH( size );
> > dicthead += size;
> >+ paddict(sizeof(cell));
> > }
> >
> >
>
> Hi Aurelien,
>
> This patch looks good to me - if you can resubmit with a SOB line
> then I'm happy to apply it.
>
Thanks I have just send it.
Best regards,
Aurelien
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien at aurel32.net http://www.aurel32.net
More information about the OpenBIOS
mailing list