All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: virtualization <virtualization@lists.osdl.org>,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH] lguest: clean rest of linkage warnings (bar one)
Date: Thu, 22 Mar 2007 21:09:42 +1100	[thread overview]
Message-ID: <1174558182.2713.151.camel@localhost.localdomain> (raw)
In-Reply-To: <1174532243.2713.95.camel@localhost.localdomain>

My previous warning fix broke lguest if your text size wasn't correct
to make the __start_paravirtprobe aligned correctly.  Put the separate
paravirtprobe section back, but inside the init section so it gets
discarded.

It also fixes the remaining warnings, except one.  The code in
modpost.c which needs to be taught that it's legal to link from
.paravirtprobe to .init.text is horrible, and I'm pretty sure I'd just
make it worse.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff -r a38b5b461807 arch/i386/kernel/vmlinux.lds.S
--- a/arch/i386/kernel/vmlinux.lds.S	Thu Mar 22 19:28:55 2007 +1100
+++ b/arch/i386/kernel/vmlinux.lds.S	Thu Mar 22 20:12:26 2007 +1100
@@ -145,12 +145,7 @@ SECTIONS
 	*(.init.text)
 	_einittext = .;
   }
-  .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
-	*(.init.data)
-  	__start_paravirtprobe = .;
-	*(.paravirtprobe)
-  	__stop_paravirtprobe = .;
-  }
+  .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
   . = ALIGN(16);
   .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
   	__setup_start = .;
@@ -178,6 +173,11 @@ SECTIONS
 	*(.altinstr_replacement)
   }
   . = ALIGN(4);
+  .paravirtprobe : AT(ADDR(.paravirtprobe) - LOAD_OFFSET) {
+ 	__start_paravirtprobe = .;
+	*(.paravirtprobe)
+  	__stop_paravirtprobe = .;
+  }
   .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
   	__start_parainstructions = .;
 	*(.parainstructions)
diff -r a38b5b461807 arch/i386/lguest/core.c
--- a/arch/i386/lguest/core.c	Thu Mar 22 19:28:55 2007 +1100
+++ b/arch/i386/lguest/core.c	Thu Mar 22 20:21:21 2007 +1100
@@ -131,7 +131,7 @@ free_some_pages:
 	return err;
 }
 
-static __exit void unmap_hypervisor(void)
+static void unmap_hypervisor(void)
 {
 	unsigned int i;
 
diff -r a38b5b461807 arch/i386/lguest/lg.h
--- a/arch/i386/lguest/lg.h	Thu Mar 22 19:28:55 2007 +1100
+++ b/arch/i386/lguest/lg.h	Thu Mar 22 20:20:15 2007 +1100
@@ -38,7 +38,7 @@ struct lguest_regs
 	u32 ss;
 };
 
-__exit void free_pagetables(void);
+void free_pagetables(void);
 __init int init_pagetables(struct page **hype_page, int pages);
 
 /* Full 4G segment descriptors, suitable for CS and DS. */
diff -r a38b5b461807 arch/i386/lguest/lguest.c
--- a/arch/i386/lguest/lguest.c	Thu Mar 22 19:28:55 2007 +1100
+++ b/arch/i386/lguest/lguest.c	Thu Mar 22 20:40:22 2007 +1100
@@ -550,7 +550,7 @@ static __attribute_used__ __init void lg
 	start_kernel();
 }
 
-asm(".section .init.text\n"
+asm(".pushsection .init.text,\"ax\",@progbits\n"
     "lguest_maybe_init:\n"
     "	cmpl $"__stringify(LGUEST_MAGIC_EBP)", %ebp\n"
     "	jne 1f\n"
@@ -558,6 +558,7 @@ asm(".section .init.text\n"
     "	jne 1f\n"
     "	cmpl $"__stringify(LGUEST_MAGIC_ESI)", %esi\n"
     "	je lguest_init\n"
-    "1: ret");
+    "1: ret\n"
+    ".popsection");
 extern void asmlinkage lguest_maybe_init(void);
 paravirt_probe(lguest_maybe_init);
diff -r a38b5b461807 arch/i386/lguest/page_tables.c
--- a/arch/i386/lguest/page_tables.c	Thu Mar 22 19:28:55 2007 +1100
+++ b/arch/i386/lguest/page_tables.c	Thu Mar 22 20:06:03 2007 +1100
@@ -381,7 +381,7 @@ __init int init_pagetables(struct page *
 	return 0;
 }
 
-__exit void free_pagetables(void)
+void free_pagetables(void)
 {
 	free_hypervisor_pte_pages();
 }



  reply	other threads:[~2007-03-22 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22  2:57 [PATCH] lguest: clean up some l"references .init.text" warnings Rusty Russell
2007-03-22 10:09 ` Rusty Russell [this message]
2007-03-22 11:45   ` [PATCH] lguest: clean rest of linkage warnings (bar one) Sam Ravnborg
2007-03-23  7:25     ` Rusty Russell
2007-03-23 19:05       ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1174558182.2713.151.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=virtualization@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.