From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753472Ab2AHLv0 (ORCPT ); Sun, 8 Jan 2012 06:51:26 -0500 Received: from terminus.zytor.com ([198.137.202.10]:39237 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751814Ab2AHLvX (ORCPT ); Sun, 8 Jan 2012 06:51:23 -0500 Date: Sun, 8 Jan 2012 03:51:09 -0800 From: tip-bot for David Daney Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com, rostedt@goodmis.org, david.daney@cavium.com, tglx@linutronix.de Reply-To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, david.daney@cavium.com, tglx@linutronix.de In-Reply-To: <1324345362-12230-1-git-send-email-ddaney.cavm@gmail.com> References: <1324345362-12230-1-git-send-email-ddaney.cavm@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] recordmcount: Fix handling of elf64 big-endian objects. Git-Commit-ID: 2e885057b7f75035f0b85e02f737891482815a81 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (terminus.zytor.com [127.0.0.1]); Sun, 08 Jan 2012 03:51:15 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 2e885057b7f75035f0b85e02f737891482815a81 Gitweb: http://git.kernel.org/tip/2e885057b7f75035f0b85e02f737891482815a81 Author: David Daney AuthorDate: Mon, 19 Dec 2011 17:42:42 -0800 Committer: Steven Rostedt CommitDate: Fri, 6 Jan 2012 17:06:42 -0500 recordmcount: Fix handling of elf64 big-endian objects. In ELF64, the sh_flags field is 64-bits wide. recordmcount was erroneously treating it as a 32-bit wide field. For little endian objects this works because the flags of interest (SHF_EXECINSTR) reside in the lower 32 bits of the word, and you get the same result with either a 32-bit or 64-bit read. Big endian objects on the other hand do not work at all with this error. The fix: Correctly treat sh_flags as 64-bits wide in elf64 objects. The symptom I observed was that my __start_mcount_loc..__stop_mcount_loc was empty even though ftrace function tracing was enabled. Link: http://lkml.kernel.org/r/1324345362-12230-1-git-send-email-ddaney.cavm@gmail.com Cc: stable@kernel.org # 3.0+ Signed-off-by: David Daney Signed-off-by: Steven Rostedt --- scripts/recordmcount.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h index f40a6af6..54e35c1 100644 --- a/scripts/recordmcount.h +++ b/scripts/recordmcount.h @@ -462,7 +462,7 @@ __has_rel_mcount(Elf_Shdr const *const relhdr, /* is SHT_REL or SHT_RELA */ succeed_file(); } if (w(txthdr->sh_type) != SHT_PROGBITS || - !(w(txthdr->sh_flags) & SHF_EXECINSTR)) + !(_w(txthdr->sh_flags) & SHF_EXECINSTR)) return NULL; return txtname; }