-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Russell King
committed
Feb 25, 2010
1 parent
d6d502f
commit 5de813b
Showing
4 changed files
with
64 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#define _LINUX_STRING_H_ | ||
|
||
#include <linux/compiler.h> /* for inline */ | ||
#include <linux/types.h> /* for size_t */ | ||
#include <linux/stddef.h> /* for NULL */ | ||
#include <linux/linkage.h> | ||
#include <asm/string.h> | ||
|
||
extern unsigned long free_mem_ptr; | ||
extern unsigned long free_mem_end_ptr; | ||
extern void error(char *); | ||
|
||
#define STATIC static | ||
|
||
#define ARCH_HAS_DECOMP_WDOG | ||
|
||
/* Diagnostic functions */ | ||
#ifdef DEBUG | ||
# define Assert(cond,msg) {if(!(cond)) error(msg);} | ||
# define Trace(x) fprintf x | ||
# define Tracev(x) {if (verbose) fprintf x ;} | ||
# define Tracevv(x) {if (verbose>1) fprintf x ;} | ||
# define Tracec(c,x) {if (verbose && (c)) fprintf x ;} | ||
# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;} | ||
#else | ||
# define Assert(cond,msg) | ||
# define Trace(x) | ||
# define Tracev(x) | ||
# define Tracevv(x) | ||
# define Tracec(c,x) | ||
# define Tracecv(c,x) | ||
#endif | ||
|
||
#ifdef CONFIG_KERNEL_GZIP | ||
#include "../../../../lib/decompress_inflate.c" | ||
#endif | ||
|
||
#ifdef CONFIG_KERNEL_LZO | ||
#include "../../../../lib/decompress_unlzo.c" | ||
#endif | ||
|
||
void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)) | ||
{ | ||
decompress(input, len, NULL, NULL, output, NULL, error); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters