diff options
-rw-r--r-- | arch/i386/kernel/head.S | 17 | ||||
-rw-r--r-- | arch/i386/kernel/vmlinux.lds.S | 7 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 10 |
3 files changed, 29 insertions, 5 deletions
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index 6c7f71176977..734be5572eb9 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S | |||
@@ -53,6 +53,7 @@ | |||
53 | * any particular GDT layout, because we load our own as soon as we | 53 | * any particular GDT layout, because we load our own as soon as we |
54 | * can. | 54 | * can. |
55 | */ | 55 | */ |
56 | .section .text.head,"ax",@progbits | ||
56 | ENTRY(startup_32) | 57 | ENTRY(startup_32) |
57 | 58 | ||
58 | #ifdef CONFIG_PARAVIRT | 59 | #ifdef CONFIG_PARAVIRT |
@@ -141,16 +142,25 @@ page_pde_offset = (__PAGE_OFFSET >> 20); | |||
141 | jb 10b | 142 | jb 10b |
142 | movl %edi,(init_pg_tables_end - __PAGE_OFFSET) | 143 | movl %edi,(init_pg_tables_end - __PAGE_OFFSET) |
143 | 144 | ||
144 | #ifdef CONFIG_SMP | ||
145 | xorl %ebx,%ebx /* This is the boot CPU (BSP) */ | 145 | xorl %ebx,%ebx /* This is the boot CPU (BSP) */ |
146 | jmp 3f | 146 | jmp 3f |
147 | |||
148 | /* | 147 | /* |
149 | * Non-boot CPU entry point; entered from trampoline.S | 148 | * Non-boot CPU entry point; entered from trampoline.S |
150 | * We can't lgdt here, because lgdt itself uses a data segment, but | 149 | * We can't lgdt here, because lgdt itself uses a data segment, but |
151 | * we know the trampoline has already loaded the boot_gdt_table GDT | 150 | * we know the trampoline has already loaded the boot_gdt_table GDT |
152 | * for us. | 151 | * for us. |
152 | * | ||
153 | * If cpu hotplug is not supported then this code can go in init section | ||
154 | * which will be freed later | ||
153 | */ | 155 | */ |
156 | |||
157 | #ifdef CONFIG_HOTPLUG_CPU | ||
158 | .section .text,"ax",@progbits | ||
159 | #else | ||
160 | .section .init.text,"ax",@progbits | ||
161 | #endif | ||
162 | |||
163 | #ifdef CONFIG_SMP | ||
154 | ENTRY(startup_32_smp) | 164 | ENTRY(startup_32_smp) |
155 | cld | 165 | cld |
156 | movl $(__BOOT_DS),%eax | 166 | movl $(__BOOT_DS),%eax |
@@ -208,8 +218,8 @@ ENTRY(startup_32_smp) | |||
208 | xorl %ebx,%ebx | 218 | xorl %ebx,%ebx |
209 | incl %ebx | 219 | incl %ebx |
210 | 220 | ||
211 | 3: | ||
212 | #endif /* CONFIG_SMP */ | 221 | #endif /* CONFIG_SMP */ |
222 | 3: | ||
213 | 223 | ||
214 | /* | 224 | /* |
215 | * Enable paging | 225 | * Enable paging |
@@ -492,6 +502,7 @@ ignore_int: | |||
492 | #endif | 502 | #endif |
493 | iret | 503 | iret |
494 | 504 | ||
505 | .section .text | ||
495 | #ifdef CONFIG_PARAVIRT | 506 | #ifdef CONFIG_PARAVIRT |
496 | startup_paravirt: | 507 | startup_paravirt: |
497 | cld | 508 | cld |
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S index 5038a73d554e..ca51610955df 100644 --- a/arch/i386/kernel/vmlinux.lds.S +++ b/arch/i386/kernel/vmlinux.lds.S | |||
@@ -37,9 +37,14 @@ SECTIONS | |||
37 | { | 37 | { |
38 | . = LOAD_OFFSET + LOAD_PHYSICAL_ADDR; | 38 | . = LOAD_OFFSET + LOAD_PHYSICAL_ADDR; |
39 | phys_startup_32 = startup_32 - LOAD_OFFSET; | 39 | phys_startup_32 = startup_32 - LOAD_OFFSET; |
40 | |||
41 | .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) { | ||
42 | _text = .; /* Text and read-only data */ | ||
43 | *(.text.head) | ||
44 | } :text = 0x9090 | ||
45 | |||
40 | /* read-only */ | 46 | /* read-only */ |
41 | .text : AT(ADDR(.text) - LOAD_OFFSET) { | 47 | .text : AT(ADDR(.text) - LOAD_OFFSET) { |
42 | _text = .; /* Text and read-only data */ | ||
43 | *(.text) | 48 | *(.text) |
44 | SCHED_TEXT | 49 | SCHED_TEXT |
45 | LOCK_TEXT | 50 | LOCK_TEXT |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 2aa47623f5f8..569e68410d7a 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -641,12 +641,20 @@ static int secref_whitelist(const char *modname, const char *tosec, | |||
641 | if (f1 && f2) | 641 | if (f1 && f2) |
642 | return 1; | 642 | return 1; |
643 | 643 | ||
644 | /* Whitelist all references from .pci_fixup section if vmlinux */ | 644 | /* Whitelist all references from .pci_fixup section if vmlinux |
645 | * Whitelist all refereces from .text.head to .init.data if vmlinux | ||
646 | * Whitelist all refereces from .text.head to .init.text if vmlinux | ||
647 | */ | ||
645 | if (is_vmlinux(modname)) { | 648 | if (is_vmlinux(modname)) { |
646 | if ((strcmp(fromsec, ".pci_fixup") == 0) && | 649 | if ((strcmp(fromsec, ".pci_fixup") == 0) && |
647 | (strcmp(tosec, ".init.text") == 0)) | 650 | (strcmp(tosec, ".init.text") == 0)) |
648 | return 1; | 651 | return 1; |
649 | 652 | ||
653 | if ((strcmp(fromsec, ".text.head") == 0) && | ||
654 | ((strcmp(tosec, ".init.data") == 0) || | ||
655 | (strcmp(tosec, ".init.text") == 0))) | ||
656 | return 1; | ||
657 | |||
650 | /* Check for pattern 3 */ | 658 | /* Check for pattern 3 */ |
651 | for (s = pat3refsym; *s; s++) | 659 | for (s = pat3refsym; *s; s++) |
652 | if (strcmp(refsymname, *s) == 0) | 660 | if (strcmp(refsymname, *s) == 0) |