]> xenbits.xensource.com Git - xen.git/commitdiff
x86: move alternative.c data fully into .init.*
authorJan Beulich <jbeulich@suse.com>
Mon, 30 Jun 2014 14:01:03 +0000 (16:01 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 30 Jun 2014 14:01:03 +0000 (16:01 +0200)
This wasn't done upon the initial addition of the file since the
section processing needs some adjustment for this: We can't mark the
two arrays needing relocations as either __initdata or __initconst, as
both have the potential of creating section conflicts (with -fPIC the
compiler may want to mark the section writable due to the necessary
relocations, colliding with other __initconst uses, and if the compiler
chooses to use the provided section name, __initdata on a constant
object might collide with other __initdata uses). However, local data
known to be referenced only by init code/data can also safely be moved
into .init.*. Hence the respective logic is being tweaked such that it
won't complain on non-empty .*.local sections.

While at it also drop the non-local section names from
SPECIAL_DATA_SECTIONS - they can't be safely converted.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/Rules.mk
xen/arch/x86/Makefile
xen/arch/x86/alternative.c

index b0d463401ac07b2b1967081ef7441c7c258dbc27..b49f3c87745bf455a0e03364e75ec8f1d7cbc6ac 100644 (file)
@@ -167,11 +167,12 @@ _clean_%/: FORCE
        $(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)
+                        $(foreach r,rel rel.ro,data.$(r).local)
 
 $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): %.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 \
+               .*.local) ;; \
                .text|.text.*|.data|.data.*|.bss) \
                        test $$sz != 0 || continue; \
                        echo "Error: size of $<:$$name is 0x$$sz" >&2; \
index 6c90b1b083fb6e63c9805e7d616e77a351b9bd40..c1e244de7933aeb1e2ae06fc6e0fd3d8f893b5d2 100644 (file)
@@ -7,7 +7,7 @@ subdir-y += oprofile
 
 subdir-$(x86_64) += x86_64
 
-obj-y += alternative.o
+obj-bin-y += alternative.init.o
 obj-y += apic.o
 obj-y += bitops.o
 obj-bin-y += bzimage.init.o
index e91fb87efb13e084bc4a8b4c4b8fdf8d43908ac8..27437924c4bf7ce7915c0ad7e5be41c0a414121e 100644 (file)
@@ -39,7 +39,7 @@ static const unsigned char k8nops[] __initconst = {
     K8_NOP7,
     K8_NOP8
 };
-static const unsigned char * const k8_nops[ASM_NOP_MAX+1] /*__initconst*/ = {
+static const unsigned char * const k8_nops[ASM_NOP_MAX+1] = {
     NULL,
     k8nops,
     k8nops + 1,
@@ -63,7 +63,7 @@ static const unsigned char p6nops[] __initconst = {
     P6_NOP7,
     P6_NOP8
 };
-static const unsigned char * const p6_nops[ASM_NOP_MAX+1] /*__initconst*/ = {
+static const unsigned char * const p6_nops[ASM_NOP_MAX+1] = {
     NULL,
     p6nops,
     p6nops + 1,