aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2007-01-26 03:56:48 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-26 16:50:58 -0500
commite5b97dde514f9bd43f9e525451d0a863c4fc8a9a (patch)
treee1096d4446c5dab878b50b7001cd58ab9ce5fa45
parentb6558c4a2378af06f2beca6c8a3304e21d1cf135 (diff)
[PATCH] Add VM_ALWAYSDUMP
This patch adds the VM_ALWAYSDUMP flag for vm_flags in vm_area_struct. This provides a clean explicit way to have a vma always included in core dumps, as is needed for vDSO's. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/binfmt_elf.c4
-rw-r--r--include/linux/mm.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 7cb28720f90e..6fec8bfa6bac 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1178,6 +1178,10 @@ static int dump_seek(struct file *file, loff_t off)
1178 */ 1178 */
1179static int maydump(struct vm_area_struct *vma) 1179static int maydump(struct vm_area_struct *vma)
1180{ 1180{
1181 /* The vma can be set up to tell us the answer directly. */
1182 if (vma->vm_flags & VM_ALWAYSDUMP)
1183 return 1;
1184
1181 /* Do not dump I/O mapped devices or special mappings */ 1185 /* Do not dump I/O mapped devices or special mappings */
1182 if (vma->vm_flags & (VM_IO | VM_RESERVED)) 1186 if (vma->vm_flags & (VM_IO | VM_RESERVED))
1183 return 0; 1187 return 0;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 76912231af41..2d2c08d5f473 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -168,6 +168,7 @@ extern unsigned int kobjsize(const void *objp);
168#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 168#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
169#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ 169#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */
170#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ 170#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
171#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */
171 172
172#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 173#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
173#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 174#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS