Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen: fix section usage in xen-head.S and setup.c

additional section for .init.text appending a number.

A side effect of this was a section mismatch warning because modpost did
not recognize a .init.text section named .init.text.1: WARNING:
vmlinux.o(.text.head+0x247): Section mismatch: reference to
.init.text.1:start_kernel (between 'is386' and 'check_x87')

Fix this by hardcoding the "ax" in the pushsection. Thanks to Torlaf for
reporting this.

Alan Modra provided the hint that made me able to locate the root cause of
this warning. And Mike Frysinger told me how to properly fix it using
__INIT/__FINIT.

Fix following Section mismatch warning in addition:
WARNING: vmlinux.o(.text+0x14c8): Section mismatch: reference to .init.data:vsyscall_int80_start (between 'fiddle_vdso' and 'xen_setup_features')

fiddle_vdso was only used from a __init function - so declare it __init.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Sam Ravnborg and committed by
Ingo Molnar
08b6d290 e68decb5

+5 -3
+1 -1
arch/x86/xen/setup.c
··· 60 60 /* 61 61 * Set the bit indicating "nosegneg" library variants should be used. 62 62 */ 63 - static void fiddle_vdso(void) 63 + static void __init fiddle_vdso(void) 64 64 { 65 65 extern const char vdso32_default_start; 66 66 u32 *mask = VDSO32_SYMBOL(&vdso32_default_start, NOTE_MASK);
+4 -2
arch/x86/xen/xen-head.S
··· 4 4 #ifdef CONFIG_XEN 5 5 6 6 #include <linux/elfnote.h> 7 + #include <linux/init.h> 7 8 #include <asm/boot.h> 8 9 #include <xen/interface/elfnote.h> 9 10 10 - .pushsection .init.text 11 + __INIT 11 12 ENTRY(startup_xen) 12 13 movl %esi,xen_start_info 13 14 cld 14 15 movl $(init_thread_union+THREAD_SIZE),%esp 15 16 jmp xen_start_kernel 16 - .popsection 17 + 18 + __FINIT 17 19 18 20 .pushsection .bss.page_aligned 19 21 .align PAGE_SIZE_asm