From: Russell King Date: Wed, 10 Mar 2010 23:23:53 +0000 (-0800) Subject: decompress: fix new decompressor for PIC X-Git-Tag: v2.6.34-rc2~79 X-Git-Url: https://bbs.cooldavid.org/git/?a=commitdiff_plain;h=5ceaa2f39bfa73c4398cd01e78f1c3ebde3d3383;p=net-next-2.6.git decompress: fix new decompressor for PIC The ARM kernel decompressor wants to be able to relocate r/w data independently from the rest of the image, and we do this by ensuring that r/w data has global visibility. Define STATIC_RW_DATA to be empty to achieve this. Signed-off-by: Russell King Cc: Alain Knaff Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index 5032b9a31ae..ad5ec1d0475 100644 --- a/include/linux/decompress/mm.h +++ b/include/linux/decompress/mm.h @@ -14,11 +14,21 @@ /* Code active when included from pre-boot environment: */ +/* + * Some architectures want to ensure there is no local data in their + * pre-boot environment, so that data can arbitarily relocated (via + * GOT references). This is achieved by defining STATIC_RW_DATA to + * be null. + */ +#ifndef STATIC_RW_DATA +#define STATIC_RW_DATA static +#endif + /* A trivial malloc implementation, adapted from * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 */ -static unsigned long malloc_ptr; -static int malloc_count; +STATIC_RW_DATA unsigned long malloc_ptr; +STATIC_RW_DATA int malloc_count; static void *malloc(int size) {