From 79a675c8a8bf321ae0dbfe24c2ef6a913c60b6e7 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 18 Oct 2008 20:28:23 -0700 Subject: [PATCH] --- yaml --- r: 115947 b: refs/heads/master c: 656eb2cd5da153762f2e8419ca117ce12ef522c3 h: refs/heads/master i: 115945: fcbb12d286c627e8469ec71919dec699cb46eb40 115943: 6b2024e6b9846d1dbf7775edd6a3ae06807aed3d v: v3 --- [refs] | 2 +- trunk/fs/Kconfig.binfmt | 22 ++++++++++++++++++++++ trunk/include/linux/sched.h | 8 +++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 5f35dd122405..68a1463808ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6409324b385f3f63a03645b4422e3be67348d922 +refs/heads/master: 656eb2cd5da153762f2e8419ca117ce12ef522c3 diff --git a/trunk/fs/Kconfig.binfmt b/trunk/fs/Kconfig.binfmt index 801db1341811..ce9fb3fbfae4 100644 --- a/trunk/fs/Kconfig.binfmt +++ b/trunk/fs/Kconfig.binfmt @@ -40,6 +40,28 @@ config BINFMT_ELF_FDPIC It is also possible to run FDPIC ELF binaries on MMU linux also. +config CORE_DUMP_DEFAULT_ELF_HEADERS + bool "Write ELF core dumps with partial segments" + default n + depends on BINFMT_ELF + help + ELF core dump files describe each memory mapping of the crashed + process, and can contain or omit the memory contents of each one. + The contents of an unmodified text mapping are omitted by default. + + For an unmodified text mapping of an ELF object, including just + the first page of the file in a core dump makes it possible to + identify the build ID bits in the file, without paying the i/o + cost and disk space to dump all the text. However, versions of + GDB before 6.7 are confused by ELF core dump files in this format. + + The core dump behavior can be controlled per process using + the /proc/PID/coredump_filter pseudo-file; this setting is + inherited. See Documentation/filesystems/proc.txt for details. + + This config option changes the default setting of coredump_filter + seen at boot time. If unsure, say N. + config BINFMT_FLAT bool "Kernel support for flat binaries" depends on !MMU && (!FRV || BROKEN) diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 017cc914ef1f..f52dbd3587a7 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -411,7 +411,13 @@ extern int get_dumpable(struct mm_struct *mm); (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT) #define MMF_DUMP_FILTER_DEFAULT \ ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED) |\ - (1 << MMF_DUMP_HUGETLB_PRIVATE)) + (1 << MMF_DUMP_HUGETLB_PRIVATE) | MMF_DUMP_MASK_DEFAULT_ELF) + +#ifdef CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS +# define MMF_DUMP_MASK_DEFAULT_ELF (1 << MMF_DUMP_ELF_HEADERS) +#else +# define MMF_DUMP_MASK_DEFAULT_ELF 0 +#endif struct sighand_struct { atomic_t count;