linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mohan Kumar M <mohan@in.ibm.com>
To: ppcdev <linuxppc-dev@ozlabs.org>
Cc: paulus@samba.org, miltonm@bga.com
Subject: [PATCH 3/5] Apply relocation
Date: Tue, 12 Aug 2008 01:45:47 +0530	[thread overview]
Message-ID: <20080811201547.GC26566@in.ibm.com> (raw)
In-Reply-To: <20080811201120.GA25283@in.ibm.com>

Apply relocation

This code is a wrapper around regular kernel. This checks whether the
kernel is loaded at 32MB, if its not loaded at 32MB, its treated as a
regular kernel and the control is given to the kernel immediately. If
the kernel is loaded at 32MB, it applies relocation delta to each offset
in the list which was generated and appended by patch 1 and 2. After
updating all offsets, control is given to the relocatable kernel.

Signed-off-by: Mohan Kumar M <mohan@in.ibm.com>
---
 arch/powerpc/boot/vmlinux.lds.S     |   28 ++++++++++++++++++++++++++++
 arch/powerpc/boot/vmlinux.reloc.scr |    8 ++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/vmlinux.lds.S
 create mode 100644 arch/powerpc/boot/vmlinux.reloc.scr

diff --git a/arch/powerpc/boot/vmlinux.lds.S b/arch/powerpc/boot/vmlinux.lds.S
new file mode 100644
index 0000000..245c667
--- /dev/null
+++ b/arch/powerpc/boot/vmlinux.lds.S
@@ -0,0 +1,28 @@
+#include <asm/page.h>
+#include <asm-generic/vmlinux.lds.h>
+
+ENTRY(start_wrap)
+
+OUTPUT_ARCH(powerpc:common64)
+SECTIONS
+{
+	. = KERNELBASE;
+
+/*
+ * Text, read only data and other permanent read-only sections
+ */
+	/* Text and gots */
+	.text : {
+		_head = .;
+		*(.text.head)
+		_ehead = .;
+
+		_text = .;
+		*(.vmlinux)
+		_etext = .;
+
+		_reloc = .;
+		*(.text.reloc)
+		_ereloc = .;
+	}
+}
diff --git a/arch/powerpc/boot/vmlinux.reloc.scr b/arch/powerpc/boot/vmlinux.reloc.scr
new file mode 100644
index 0000000..7240b6b
--- /dev/null
+++ b/arch/powerpc/boot/vmlinux.reloc.scr
@@ -0,0 +1,8 @@
+SECTIONS
+{
+  .vmlinux : {
+	input_len = .;
+	*(.data)
+	output_len = . - 8;
+	}
+}
-- 
1.5.4

  parent reply	other threads:[~2008-08-11 20:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 20:11 [PATCH 0/5] Relocatable kernel support for PPC64 Mohan Kumar M
2008-08-11 20:12 ` [PATCH 1/5] Extract list of relocation offsets Mohan Kumar M
2008-08-11 20:14 ` [PATCH 2/5] Build files needed for relocation Mohan Kumar M
2008-08-12  8:07   ` Mohan Kumar M
2008-08-12  8:09   ` Mohan Kumar M
2008-08-11 20:15 ` Mohan Kumar M [this message]
2008-08-12  0:23   ` [PATCH 3/5] Apply relocation Paul Mackerras
2008-08-12  8:10   ` Mohan Kumar M
2008-08-13  5:11     ` Paul Mackerras
2008-08-11 20:16 ` [PATCH 4/5] Relocation support Mohan Kumar M
2008-08-12  8:11   ` Mohan Kumar M
2008-08-13  5:20     ` Paul Mackerras
2008-08-13 18:22       ` Mohan Kumar M
2008-08-11 20:18 ` [PATCH 5/5] Relocation support for kdump kernel Mohan Kumar M
2008-08-12  8:11   ` Mohan Kumar M

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=20080811201547.GC26566@in.ibm.com \
    --to=mohan@in.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).