[PATCH] ARM: put a valid "barebox" signature in the header on big-endian systems.

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Sat May 12 17:38:45 EDT 2012

Hello Krzysztof,

On Sat, May 05, 2012 at 11:47:19PM +0200, Krzysztof Halasa wrote:
> Signed-off-by: Krzysztof Hałasa <khc at pm.waw.pl>
> diff --git a/arch/arm/include/asm/barebox-arm-head.h b/arch/arm/include/asm/barebox-arm-head.h
> index 0dc3074..2c250e9 100644
> --- a/arch/arm/include/asm/barebox-arm-head.h
> +++ b/arch/arm/include/asm/barebox-arm-head.h
> @@ -24,8 +24,7 @@ static inline void barebox_arm_head(void)
>  		"1: b 1b\n"
>  		"1: b 1b\n"
>  #endif
> -		".word 0x65726162\n"			/* 'bare' */
> -		".word 0x00786f62\n"			/* 'box' */
> +		".asciz \"barebox\"\n"
>  		".word _text\n"				/* text base. If copied there,
>  							 * barebox can skip relocation
>  							 */
Another downside of this patch (apart from the file type detection that
still needs adaption?) is that the magic is different depending on
endianess. I'm not sure if it really matters, but this change makes it
harder (or at least more error prone) for tools like file(1) to detect
the image type. (Well, it might be hard anyhow, as barebox does have a
machine specific header anyhow depending on the machine.)

Moreover I wonder what the motivation here is to change a magic. Was it
just "oh, this looks ugly"? If yes, is that enough?

Just my 0.02€ on this patch, I don't know how many big endian barebox
images are out there and I don't really care (neither about big endian
images nor about this change). So feel free to ignore my concerns if you
know better.

Best regards

Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

More information about the barebox mailing list