[PATCH 7/7] ARM: Thumb-2: Restore sensible zImage header layout for CONFIG_THUMB2_KERNEL

Russell King - ARM Linux linux at arm.linux.org.uk
Tue Nov 16 15:35:20 EST 2010


On Tue, Nov 16, 2010 at 03:28:44PM -0500, Nicolas Pitre wrote:
> On Tue, 16 Nov 2010, Russell King - ARM Linux wrote:
> > Not used anymore - it's practically zero (and unused) for most cases
> > now anyway.
> 
> I think it is worth preserving this layout regardless.  First of all 
> this is really cheap to do, and if whatever bootloader out there is 
> relying on it, at least the magic number, then better not break it 
> freely.

It's already broken by the relocatable format - which has zero as the
start address.  That's been in for a few years now, and no one even
noticed that this header ended up with zero as the entry address.
Therefore, I suggest that no one at all is using it.

> On the other hand... we could simply decide _not_ to fix it on the 
> basis that this will create a different header for a pure Thumb2 
> image.
> 
> Maybe it is a better idea to preserve the current header as is with the 
> ARM mode nops and perform the switch to Thumb mode using the branch 
> instruction after those 8 nops.  This way the kernel image format will 
> remain compatible with existing bootloaders without a need for 
> bootloaders to know if the image is ARM or Thumb mode.

That is definitely worth doing, and sounds like a better idea.



More information about the linux-arm-kernel mailing list