[PATCH] Clean up ARM compressed loader
From: nico@fluxnic.net (Nicolas Pitre)
Date: 2010-02-25 19:24:01
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 [off-list ref]Acked-by: Nicolas Pitre <nico@fluxnic.net> However...
quoted hunk ↗ jump to hunk
@@ -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