aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-03-09 16:20:13 +0000
committerJan Beulich <jbeulich@novell.com>2011-03-09 16:20:13 +0000
commit48115d14743e4134fcdd0b8766fc59c917ae1e79 (patch)
tree844da1e931139c0b614f55c71ec9433d166c5c19 /xen/common
parent4afea3d65321c40bb8afec833c860f92176bfb42 (diff)
downloadxen-48115d14743e4134fcdd0b8766fc59c917ae1e79.tar.gz
xen-48115d14743e4134fcdd0b8766fc59c917ae1e79.tar.bz2
xen-48115d14743e4134fcdd0b8766fc59c917ae1e79.zip
Move more kernel decompression bits to .init.* sections
Based on how c/s 22986:076b63b74cf6 changed xen/libelf/Makefile I suppose this is compatibile with those clang/llvm changes, but I didn't actually test it. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/common')
-rw-r--r--xen/common/Makefile2
-rw-r--r--xen/common/inflate.c19
-rw-r--r--xen/common/libelf/Makefile2
-rw-r--r--xen/common/unlzma.c2
-rw-r--r--xen/common/xz/dec_bcj.c5
5 files changed, 15 insertions, 15 deletions
diff --git a/xen/common/Makefile b/xen/common/Makefile
index f5be34f898..1c2a5ca741 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -43,7 +43,7 @@ obj-y += radix-tree.o
obj-y += rbtree.o
obj-y += lzo.o
-obj-$(CONFIG_X86) += decompress.o bunzip2.o unxz.o unlzma.o unlzo.o
+obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo,$(n).init.o)
obj-$(perfc) += perfc.o
obj-$(crash_debug) += gdbstub.o
diff --git a/xen/common/inflate.c b/xen/common/inflate.c
index 999a33bce0..f99c985d61 100644
--- a/xen/common/inflate.c
+++ b/xen/common/inflate.c
@@ -120,6 +120,7 @@ static char rcsid[] = "#Id: inflate.c,v 0.14 1993/06/10 13:27:04 jloup Exp #";
#ifndef INIT
#define INIT
+#define INITDATA
#endif
#define slide window
@@ -216,8 +217,8 @@ static const ush cpdext[] = { /* Extra bits for distance codes */
the stream.
*/
-STATIC ulg bb; /* bit buffer */
-STATIC unsigned bk; /* bits in bit buffer */
+STATIC ulg INITDATA bb; /* bit buffer */
+STATIC unsigned INITDATA bk; /* bits in bit buffer */
STATIC const ush mask_bits[] = {
0x0000,
@@ -234,10 +235,10 @@ STATIC const ush mask_bits[] = {
* malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
*/
-static unsigned long malloc_ptr;
-static int malloc_count;
+static unsigned long INITDATA malloc_ptr;
+static int INITDATA malloc_count;
-static void *malloc(int size)
+static void *INIT malloc(int size)
{
void *p;
@@ -258,7 +259,7 @@ static void *malloc(int size)
return p;
}
-static void free(void *where)
+static void INIT free(void *where)
{
malloc_count--;
if (!malloc_count)
@@ -311,7 +312,7 @@ STATIC const int dbits = 6; /* bits in base distance lookup table */
#define N_MAX 288 /* maximum number of codes in any set */
-STATIC unsigned hufts; /* track memory usage */
+STATIC unsigned INITDATA hufts; /* track memory usage */
STATIC int INIT huft_build(
@@ -1129,8 +1130,8 @@ STATIC int INIT inflate(void)
*
**********************************************************************/
-static ulg crc_32_tab[256];
-static ulg crc; /* initialized in makecrc() so it'll reside in bss */
+static ulg INITDATA crc_32_tab[256];
+static ulg INITDATA crc; /* initialized in makecrc() so it'll reside in bss */
#define CRC_VALUE (crc ^ 0xffffffffUL)
/*
diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile
index 470595af6f..18dc8e206f 100644
--- a/xen/common/libelf/Makefile
+++ b/xen/common/libelf/Makefile
@@ -1,6 +1,6 @@
obj-bin-y := libelf.o
-SECTIONS := text data rodata $(foreach n,1 2 4 8,rodata.str1.$(n)) $(foreach r,rel rel.ro,data.$(r) data.$(r).local)
+SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
libelf.o: libelf-temp.o Makefile
$(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
diff --git a/xen/common/unlzma.c b/xen/common/unlzma.c
index 2e9d038ac0..bf772d06e8 100644
--- a/xen/common/unlzma.c
+++ b/xen/common/unlzma.c
@@ -75,7 +75,7 @@ struct rc {
#define RC_MODEL_TOTAL_BITS 11
-static int nofill(void *buffer, unsigned int len)
+static int INIT nofill(void *buffer, unsigned int len)
{
return -1;
}
diff --git a/xen/common/xz/dec_bcj.c b/xen/common/xz/dec_bcj.c
index e867168a8a..fdce1eaffb 100644
--- a/xen/common/xz/dec_bcj.c
+++ b/xen/common/xz/dec_bcj.c
@@ -87,11 +87,10 @@ static inline int INIT bcj_x86_test_msbyte(uint8_t b)
static size_t INIT bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
- static /*const*/ bool_t INITDATA mask_to_allowed_status[8]
+ static const bool_t mask_to_allowed_status[8]
= { true, true, true, false, true, false, false, false };
- static /*const*/ uint8_t INITDATA mask_to_bit_num[8]
- = { 0, 1, 2, 2, 3, 3, 3, 3 };
+ static const uint8_t mask_to_bit_num[8] = { 0, 1, 2, 2, 3, 3, 3, 3 };
size_t i;
size_t prev_pos = (size_t)-1;