Re: [PATCH 2/6] include/linux/unaligned/{l,b}e_byteshift.h: Fix usage for compressed kernels

Russell King - ARM Linux
2009-08-05T21:21:06Z

On Wed, Aug 05, 2009 at 11:29:56AM +0200, Albin Tonnerre wrote:
> linux/kernel.h brings at least:
> extern int console_printk[];
> extern const char hex_asc[];
> which causes errors at link-time as they are not available when
> compiling the pre-boot environement. There are also a few others:

To be clear, for Andrew's benefit, the reason this happens is because
we disable the 'static' when building on ARM - this is because we build
the decompressor with -fPIC, so we can relocate _just_ the data segment
without writing at all to the text segment.

This is so that we can flash the compressed image into read only memory
and have the kernel boot directly from that memory, without having to
have an expensive and unnecessary copy.

Having static data and functions causes complications which make this
impossible to otherwise achieve. I don't remember the details, I'm not
an expert on the ARM shared library stuff.