diff -urN linux-2.4.32-3G+pax/arch/i386/vmlinux.lds.S linux-2.4.32-3G+pax-fixed/arch/i386/vmlinux.lds.S --- linux-2.4.32-3G+pax/arch/i386/vmlinux.lds.S 2006-01-16 16:29:33.000000000 +0100 +++ linux-2.4.32-3G+pax-fixed/arch/i386/vmlinux.lds.S 2006-01-16 16:30:48.000000000 +0100 @@ -10,8 +10,46 @@ SECTIONS { . = __PAGE_OFFSET + 0x100000; + .text.startup : { + BYTE(0xEA) /* jmp far */ + LONG(startup_32 + __KERNEL_TEXT_OFFSET - __PAGE_OFFSET) + SHORT(__KERNEL_CS) + } + + . = ALIGN(4096); /* Init code and data */ + __init_begin = .; + .data.init : { *(.data.init) } + . = ALIGN(16); + __setup_start = .; + .setup.init : { *(.setup.init) } + __setup_end = .; + __initcall_start = .; + .initcall.init : { *(.initcall.init) } + __initcall_end = .; + +#ifdef CONFIG_PAX_KERNEXEC + __text_init_start = .; + .text.init (. - __KERNEL_TEXT_OFFSET) : AT (__text_init_start) { + *(.text.init) + . = ALIGN(4*1024*1024) - 1; + BYTE(0) + } + __init_end = . + __KERNEL_TEXT_OFFSET; + +/* + * PaX: this must be kept in synch with the KERNEL_CS base + * in the GDTs in arch/i386/kernel/head.S + */ + _text = .; /* Text and read-only data */ + .text : AT (. + __KERNEL_TEXT_OFFSET) { +#else + .text.init : { *(.text.init) } + . = ALIGN(4096); + __init_end = .; _text = .; /* Text and read-only data */ .text : { +#endif + *(.text) *(.fixup) *(.gnu.warning) @@ -19,6 +57,19 @@ _etext = .; /* End of text section */ + . = ALIGN(4096); + . += __KERNEL_TEXT_OFFSET; + .rodata.page_aligned : { + *(.empty_zero_page) + *(.pg0) + +#ifdef CONFIG_X86_PAE + *(.swapper_pm_dir) +#endif + + *(.swapper_pg_dir) + *(.idt) + } .rodata : { *(.rodata) *(.rodata.*) } .kstrtab : { *(.kstrtab) } @@ -31,40 +82,36 @@ __ksymtab : { *(__ksymtab) } __stop___ksymtab = .; +#ifdef CONFIG_PAX_KERNEXEC + . = ALIGN(4*1024*1024); +#else + . = ALIGN(32); +#endif + + _data = .; .data : { /* Data */ *(.data) CONSTRUCTORS } - _edata = .; /* End of data section */ + . = ALIGN(32); + .data.cacheline_aligned : { *(.data.cacheline_aligned) } - . = ALIGN(8192); /* init_task */ + . = ALIGN(8192); .data.init_task : { *(.data.init_task) } - . = ALIGN(4096); /* Init code and data */ - __init_begin = .; - .text.init : { *(.text.init) } - .data.init : { *(.data.init) } - . = ALIGN(16); - __setup_start = .; - .setup.init : { *(.setup.init) } - __setup_end = .; - __initcall_start = .; - .initcall.init : { *(.initcall.init) } - __initcall_end = .; - . = ALIGN(4096); - __init_end = .; - . = ALIGN(4096); - .data.page_aligned : { *(.data.idt) } + .data.page_aligned : { + } - . = ALIGN(32); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } + _edata = .; /* End of data section */ __bss_start = .; /* BSS */ .bss : { *(.bss) } + __bss_end = . ; + _end = . ; /* Sections to be discarded */