ARM: Eliminate decompressor -Dstatic= PIC hack
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 25 Feb 2010 12:14:40 +0000 (12:14 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 25 Feb 2010 19:34:31 +0000 (19:34 +0000)
commit5de813b6cd06460b337f9da9afe316823cf3ef45
tree804eb5a2d986569353ac5c8728af419ce1907124
parentd6d502fa4be1acd01971476fc732c95a4da16d90
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.

Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/boot/compressed/Makefile
arch/arm/boot/compressed/decompress.c [new file with mode: 0644]
arch/arm/boot/compressed/misc.c
arch/arm/boot/compressed/vmlinux.lds.in