x86: add .data.page_aligned section
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 6 May 2010 10:52:22 +0000 (11:52 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 6 May 2010 10:52:22 +0000 (11:52 +0100)
... and move page-aligned data there, instead of having random holes
(to fulfill the demanded alignment) in the final image.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/boot/x86_32.S
xen/arch/x86/boot/x86_64.S
xen/arch/x86/x86_64/compat_kexec.S
xen/arch/x86/xen.lds.S

index fa183db86cc9258949bc578296d0f3fcf5f6aae0..d86970df4ff2ed880c709ae18b6bcb1fc123fc08 100644 (file)
@@ -61,6 +61,8 @@ ignore_int:
         jnz     0b
 1:      jmp     1b
 
+        .data
+        ALIGN
 ENTRY(stack_start)
         .long cpu0_stack
         
@@ -88,6 +90,7 @@ ENTRY(idle_pg_table)
         .long sym_phys(idle_pg_table_l2) + 2*PAGE_SIZE + 0x01, 0
         .long sym_phys(idle_pg_table_l2) + 3*PAGE_SIZE + 0x01, 0
 
+        .section .data.page_aligned, "aw", @progbits
         .align PAGE_SIZE, 0
 /* NB. Rings != 0 get access up to MACH2PHYS_VIRT_END. This allows access to */
 /*     the machine->physical mapping table. Ring 0 can access all memory.    */
index 7932f8aaa942d526687451b6b4a06e62d4c7eee4..edf789161084453efd2436bcc6efc3e11bfc23d1 100644 (file)
@@ -78,7 +78,8 @@ ignore_int:
 
 /*** DESCRIPTOR TABLES ***/
 
-        .align 8, 0xCC
+        .data
+        .align 8
 multiboot_ptr:
         .long   0
 
@@ -95,6 +96,7 @@ idt_descr:
 ENTRY(stack_start)
         .quad   cpu0_stack
 
+        .section .data.page_aligned, "aw", @progbits
         .align PAGE_SIZE, 0
 ENTRY(boot_cpu_gdt_table)
         .quad 0x0000000000000000     /* unused */
index da3136f886901d37732deb2a7e83c68306f4e56d..6977e3eb5aa26ecbb5710ff74fc1e567f0977e35 100644 (file)
@@ -151,6 +151,8 @@ compatibility_mode:
         call *%eax
         ud2
 
+        .data
+        .align 4
 compat_page_list:
         .fill 12,4,0
 
@@ -166,8 +168,8 @@ compat_pg_table:
         .long SYM_PHYS(compat_pg_table_l2) + 2*PAGE_SIZE + 0x01, 0
         .long SYM_PHYS(compat_pg_table_l2) + 3*PAGE_SIZE + 0x01, 0
 
-        .align 4096,0
-
+        .section .data.page_aligned, "aw", @progbits
+        .align PAGE_SIZE,0
 compat_pg_table_l2:
         .macro identmap from=0, count=512
         .if \count-1
index 38ba8ba3a45ffe39006441152b321ea59a19661b..20f9f2dca4f9390836296e5be4157ca3aa15c642 100644 (file)
@@ -53,6 +53,8 @@ SECTIONS
   } :text
 
   .data : {                    /* Data */
+       . = ALIGN(PAGE_SIZE);
+       *(.data.page_aligned)
        *(.data)
        CONSTRUCTORS
   } :text