aboutsummaryrefslogtreecommitdiffstats
path: root/xen/Rules.mk
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/Rules.mk
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/Rules.mk')
-rw-r--r--xen/Rules.mk12
1 files changed, 12 insertions, 0 deletions
diff --git a/xen/Rules.mk b/xen/Rules.mk
index c39706a6c7..7ab809ac9e 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -152,6 +152,18 @@ _clean_%/: FORCE
%.o: %.S Makefile
$(CC) $(AFLAGS) -c $< -o $@
+SPECIAL_DATA_SECTIONS := rodata $(foreach n,1 2 4 8,rodata.str1.$(n)) \
+ $(foreach r,rel rel.ro,data.$(r) data.$(r).local)
+
+%.init.o: %.o Makefile
+ $(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p}' | while read idx name sz rest; do \
+ case "$$name" in \
+ .text|.data|.bss) test $$sz = 0 || \
+ { echo "Error: size of $<:$$name is 0x$$sz" >&2; exit $$idx; };; \
+ esac; \
+ done
+ $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
+
%.i: %.c Makefile
$(CPP) $(CFLAGS) $< -o $@