Skip to content

Commit 5ceaa2f

Browse files
Russell Kingtorvalds
Russell King
authored andcommitted
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 <[email protected]> Cc: Alain Knaff <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 8c1840f commit 5ceaa2f

File tree

1 file changed

+12
-2
lines changed
  • include/linux/decompress

1 file changed

+12
-2
lines changed

include/linux/decompress/mm.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,21 @@
1414

1515
/* Code active when included from pre-boot environment: */
1616

17+
/*
18+
* Some architectures want to ensure there is no local data in their
19+
* pre-boot environment, so that data can arbitarily relocated (via
20+
* GOT references). This is achieved by defining STATIC_RW_DATA to
21+
* be null.
22+
*/
23+
#ifndef STATIC_RW_DATA
24+
#define STATIC_RW_DATA static
25+
#endif
26+
1727
/* A trivial malloc implementation, adapted from
1828
* malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
1929
*/
20-
static unsigned long malloc_ptr;
21-
static int malloc_count;
30+
STATIC_RW_DATA unsigned long malloc_ptr;
31+
STATIC_RW_DATA int malloc_count;
2232

2333
static void *malloc(int size)
2434
{

0 commit comments

Comments
 (0)