[Patch 7/21] Define API for reading arch specif Program Headers forCore

From: Suzuki K. Poulose
Date: Tue Dec 14 2010 - 05:05:54 EST


The binfmt ELF defines APIs for the "arch" specific Program headers to be
written to the ELF core. Define the "read" (or copy) variants of the APIs, to
collect it for the application core dump(which is a read based approach).

Signed-off-by: Suzuki K. Poulose <suzuki@xxxxxxxxxx>
---
include/linux/elfcore.h | 3 +++
kernel/elfcore.c | 6 ++++++
2 files changed, 9 insertions(+)

Index: linux-2.6.36-rc7/include/linux/elfcore.h
===================================================================
--- linux-2.6.36-rc7.orig/include/linux/elfcore.h
+++ linux-2.6.36-rc7/include/linux/elfcore.h
@@ -163,6 +163,9 @@ extern int
elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
unsigned long limit);
extern int
+elf_core_copy_extra_phdrs(char *buf, loff_t offset, size_t *size,
+ unsigned long limit);
+extern int
elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
extern size_t elf_core_extra_data_size(void);

Index: linux-2.6.36-rc7/kernel/elfcore.c
===================================================================
--- linux-2.6.36-rc7.orig/kernel/elfcore.c
+++ linux-2.6.36-rc7/kernel/elfcore.c
@@ -16,6 +16,12 @@ int __weak elf_core_write_extra_phdrs(st
return 1;
}

+int __weak elf_core_copy_extra_phdrs(char *buf, loff_t offset, size_t *size,
+ unsigned long limit)
+{
+ return 1;
+}
+
int __weak 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/