[PATCH] Clean up ARM compressed loader
Nicolas Pitre
nico at fluxnic.net
Thu Feb 25 14:24:01 EST 2010
On Thu, 25 Feb 2010, Russell King - ARM Linux wrote:
> And here's the patch - not run tested yet, but compile-tested for
> gzip and LZO in both ROM=y and ROM=n modes.
>
> ARM: Eliminate decompressor -Dstatic= PIC hack
>
> We used to build decompressors with -Dstatic= to avoid any local data
> being generated. The problem is that local data generates GOTOFF
> relocations, which means we can't relocate the data relative to the
> text segment.
>
> Global data, on the other hand, goes through the GOT, and can be
> relocated anywhere.
>
> Unfortunately, with the new decompressors, this presents a problem
> since they declare static data within functions, and this leads to
> stack overflow.
>
> Fix this by separating out the decompressor code into a separate file,
> and removing 'static' from BSS data in misc.c.
>
> Also, discard the .data section - this means that should we end up
> with read/write initialized data, the decompressor will fail to link
> and the problem will be obvious.
>
> Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
Acked-by: Nicolas Pitre <nico at fluxnic.net>
However...
> @@ -14,6 +14,7 @@ SECTIONS
> /DISCARD/ : {
> *(.ARM.exidx*)
> *(.ARM.extab*)
> + *(.data)
> }
I'd put a comment there, otherwise lots of people will go WTF when
coming across this.
Nicolas
More information about the linux-arm-kernel
mailing list