lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C4DBE8E.70102@linux.vnet.ibm.com>
Date:	Mon, 26 Jul 2010 18:57:50 +0200
From:	Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
To:	Karol Lewandowski <k.lewandowsk@...sung.com>
CC:	linux-kernel@...r.kernel.org
Subject: Re: GCOV doesn't seem to work on ARM with kernel 2.6.35-rc6

Karol Lewandowski wrote:
> On 07/26/2010 12:32 PM, Karol Lewandowski wrote:
>> I'm trying to use code coverage measurements with mainline Linux kernel
>> 2.6.35-rc6 on ARM platform (specifically on Samsung's S5PC110 board).
>>
>> I've enabled following in my .config:
>>
>> CONFIG_GCOV_KERNEL=y
>> CONFIG_DEBUG_FS=y
>>
>> After successful boot I see no gcov-related files other than
>> /sys/kernel/debug/gcov/reset.
>>
>>  From my knowledge (and from my previous experience with out-of-tree
>> gcov patchset) whole directory structure shall be created along with
>> .gcda files and various symlinks.

This expectation is correct.

> I forgot to add that I've added "GCOV_PROFILE := y" to at least
> 
>    fs/Makefile
>    kernel/Makefile
> 
> and few others.  Thus, I expect to find something more than just
> ./reset file.

I just tested gcov support for 2.6.35-rc6 on s390 and it works without
a problem. My assumption would be that you are using an EABI-GCC to
compile your kernel. Those compilers name their constructor symbols
differently than the vanilla GCC so that the whole constructor calling
mechanism on which the gcov support relies, will fail. If that is
indeed the case, the following testing patch should solve your
problem:


---
 include/asm-generic/vmlinux.lds.h |    1 +
 kernel/module.c                   |    6 ++++++
 2 files changed, 7 insertions(+)

--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -443,6 +443,7 @@
 #define KERNEL_CTORS()	. = ALIGN(8);			   \
 			VMLINUX_SYMBOL(__ctors_start) = .; \
 			*(.ctors)			   \
+			*(.init_array)			   \
 			VMLINUX_SYMBOL(__ctors_end) = .;
 #else
 #define KERNEL_CTORS()
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2405,6 +2405,12 @@ static noinline struct module *load_modu
 #ifdef CONFIG_CONSTRUCTORS
 	mod->ctors = section_objs(hdr, sechdrs, secstrings, ".ctors",
 				  sizeof(*mod->ctors), &mod->num_ctors);
+	if (!mod->num_ctors) {
+		/* Could be an EABI compiler. */
+		mod->ctors = section_objs(hdr, sechdrs, secstrings,
+					  ".init_array", sizeof(*mod->ctors),
+					  &mod->num_ctors);
+	}
 #endif
 
 #ifdef CONFIG_TRACEPOINTS

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ