]> git.baikalelectronics.ru Git - kernel.git/commit
fs/proc/kcore.c: don't add modules range to kcore if it's equal to vmcore range
authorBaoquan He <bhe@redhat.com>
Thu, 9 Oct 2014 22:25:56 +0000 (15:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Oct 2014 02:25:50 +0000 (22:25 -0400)
commit7eaca5ce351cc9a7898af2d5c7ce2c80638bb237
treeb376556f8a86c27066a849e469a940c2a6d764d0
parentdecafed8102a2e23d7abc181ddded897ba02367c
fs/proc/kcore.c: don't add modules range to kcore if it's equal to vmcore range

On some ARCHs modules range is eauql to vmalloc range. E.g on i686

"#define MODULES_VADDR   VMALLOC_START"
"#define MODULES_END     VMALLOC_END"

This will cause 2 duplicate program segments in /proc/kcore, and no flag
to indicate they are different.  This is confusing.  And usually people
who need check the elf header or read the content of kcore will check
memory ranges.  Two program segments which are the same are unnecessary.

So check if the modules range is equal to vmalloc range.  If so, just skip
adding the modules range.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Xishi Qiu <qiuxishi@huawei.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/kcore.c