From 48115d14743e4134fcdd0b8766fc59c917ae1e79 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 9 Mar 2011 16:20:13 +0000 Subject: 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 --- xen/Rules.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'xen/Rules.mk') 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 $@ -- cgit v1.2.3