On Wed, May 28, 2008 at 03:02:14PM +0100, Jeremy Fitzhardinge wrote:
I cooked up this:
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index ce5ed08..963b2ae 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -40,6 +40,7 @@ SECTIONS
.text : AT(ADDR(.text) - LOAD_OFFSET) {
. = ALIGN(PAGE_SIZE); /* not really needed, already page aligned */
*(.text.page_aligned)
+ end_text_page_aligned = .;
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@@ -49,6 +50,9 @@ SECTIONS
_etext = .; /* End of text section */
} :text = 0x9090
+ ASSERT((end_text_page_aligned == ALIGN((end_text_page_aligned), PAGE_SIZE)),
+ "Text in .text.page_aligned are not modulo PAGE_SIZE")
+
. = ALIGN(16); /* Exception table */
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
@@ -89,6 +93,8 @@ SECTIONS
*(.data.page_aligned)
*(.data.idt)
}
+ ASSERT((. == ALIGN(PAGE_SIZE)),
+ "Data in .data.page_aligned are not modulo PAGE_SIZE")
. = ALIGN(32);
.data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
But we should try to do it so all archs can benefit.
And it failed in the second ASSERT - I dunno why.
Soccer duties - so I have to run.
Sam
--