[OpenBIOS] [PATCH] forthstrap: avoid unaligned accesses

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Dec 8 12:51:13 CET 2013


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.


ATB,

Mark.



More information about the OpenBIOS mailing list