[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101214153956.1716d261@suzukikp>
Date: Tue, 14 Dec 2010 15:39:56 +0530
From: "Suzuki K. Poulose" <suzuki@...ibm.com>
To: linux-kernel@...r.kernel.org
Cc: "Suzuki K. Poulose" <suzuki@...ibm.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>,
Christoph Hellwig <hch@....de>,
Masami Hiramatsu <mhiramat@...hat.com>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Daisuke HATAYAMA <d.hatayama@...fujitsu.com>,
Andi Kleen <andi@...stfloor.org>,
Roland McGrath <roland@...hat.com>,
Amerigo Wang <amwang@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [Patch 9/21] UML (i386) Implementation of
elf_core_copy_extra_phdrs()
elf_core_copy_extra_phdrs() for UML. Adapted from elf_core_write_extra_phdrs()
Signed-off-by: Suzuki K. Poulose <suzuki@...ibm.com>
---
arch/um/sys-i386/elfcore.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
Index: linux-2.6.36-rc7/arch/um/sys-i386/elfcore.c
===================================================================
--- linux-2.6.36-rc7.orig/arch/um/sys-i386/elfcore.c
+++ linux-2.6.36-rc7/arch/um/sys-i386/elfcore.c
@@ -41,6 +41,38 @@ int elf_core_write_extra_phdrs(struct fi
return 1;
}
+int elf_core_copy_extra_phdrs(char *bufp, loff_t offset, size_t *size,
+ unsigned long limit)
+{
+ if (vsyscall_ehdr) {
+ const struct elfhdr *const ehdrp =
+ (struct elfhdr *) vsyscall_ehdr;
+ const struct elf_phdr *const phdrp =
+ (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff);
+ struct elf_phdr *phdr = (struct elf_phdr *)bufp;
+ int i;
+ Elf32_Off ofs = 0;
+
+ for (i = 0; i < ehdrp->e_phnum; ++i) {
+ *size += sizeof(*phdr);
+ if (*size > limit)
+ return 0;
+
+ *phdr = phdrp[i];
+
+ if (phdr.p_type == PT_LOAD) {
+ ofs = phdr.p_offset = offset;
+ offset += phdr.p_filesz;
+ } else {
+ phdr.p_offset += ofs;
+ }
+ phdr.p_paddr = 0; /* match other core phdrs */
+ phdr++;
+ }
+ }
+ return 1;
+}
+
int elf_core_write_extra_data(struct file *file, size_t *size,
unsigned long limit)
{
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists