mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@in.ibm.com>
To: linux kernel mailing list <linux-kernel@vger.kernel.org>
Cc: Fastboot mailing list <fastboot@lists.osdl.org>,
	Morton Andrew Morton <akpm@osdl.org>, Andi Kleen <ak@muc.de>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: [PATCH][2.6.19-rc5-mm1] i386: Convert more absolute symbols to section relative
Date: Wed, 8 Nov 2006 17:16:21 -0500	[thread overview]
Message-ID: <20061108221621.GB29705@in.ibm.com> (raw)



o Convert more absolute symbols to section relative to keep the theme in
  vmlinux.lds.S file and to avoid problem if kernel is relocated.

o Also put a message so that in future people can be aware of it and 
  avoid introducing absolute symbols.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 arch/i386/kernel/vmlinux.lds.S |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff -puN arch/i386/kernel/vmlinux.lds.S~i386-reloc-convert-more-abs-syms-to-section-relative arch/i386/kernel/vmlinux.lds.S
--- linux-2.6.19-rc5-mm1-reloc/arch/i386/kernel/vmlinux.lds.S~i386-reloc-convert-more-abs-syms-to-section-relative	2006-11-08 16:24:31.000000000 -0500
+++ linux-2.6.19-rc5-mm1-reloc-root/arch/i386/kernel/vmlinux.lds.S	2006-11-08 16:29:51.000000000 -0500
@@ -2,6 +2,12 @@
  * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
  */
 
+/* Don't define absolute symbols until and unless you know that symbol
+ * value is should remain constant even if kernel image is relocated
+ * at run time. Absolute symbols are not relocated. If symbol value should
+ * change if kernel is relocated, make the symbol section relative and
+ * put it inside the section definition.
+ */
 #define LOAD_OFFSET __PAGE_OFFSET
 
 #include <asm-generic/vmlinux.lds.h>
@@ -63,11 +69,11 @@ SECTIONS
 	CONSTRUCTORS
 	} :data
 
-  __start_paravirtprobe = .;
   .paravirtprobe : AT(ADDR(.paravirtprobe) - LOAD_OFFSET) {
+  	__start_paravirtprobe = .;
 	*(.paravirtprobe)
+  	__stop_paravirtprobe = .;
   }
-  __stop_paravirtprobe = .;
 
   . = ALIGN(4096);
   .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
@@ -163,11 +169,11 @@ SECTIONS
 	*(.altinstr_replacement)
   }
   . = ALIGN(4);
-  __start_parainstructions = .;
   .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
+  	__start_parainstructions = .;
 	*(.parainstructions)
+  	__stop_parainstructions = .;
   }
-  __stop_parainstructions = .;
   /* .exit.text is discard at runtime, not link time, to deal with references
      from .altinstructions and .eh_frame */
   .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
_

             reply	other threads:[~2006-11-08 22:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08 22:16 Vivek Goyal [this message]
2006-11-09  7:30 ` Andi Kleen

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=20061108221621.GB29705@in.ibm.com \
    --to=vgoyal@in.ibm.com \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=fastboot@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®