Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp415518ybv; Wed, 5 Feb 2020 07:47:08 -0800 (PST) X-Google-Smtp-Source: APXvYqx+lcnHtiBZTEGBLCIlqF80pDalAbbQyeaonAH3mdrm1MqrqpFyANHNsrpSxZpJQ3mp3jpA X-Received: by 2002:a05:6808:b13:: with SMTP id s19mr3202081oij.119.1580917628691; Wed, 05 Feb 2020 07:47:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580917628; cv=none; d=google.com; s=arc-20160816; b=pmL4qENPcNntUR8d5sc+5uFzrPEQM6OhRZyzBc8l/517R7cgb/yNYZki6byt+KoqV2 3fLZg5H3lZQQEh9VkYDZkD44q97cxazNchSm1HzrKX/8SkxT3tpHfpS9YZGjph65zVgN 1lFxR3jMtDOg84EegJE4yJLxxoBsanljNIDf8Ujp0/5Hr8ucJOQXCC980QcgYcWx6D1B ZngQBgXmlIYMNO2zEi5pCEIbSJGfcYTpJ90uGm00iUkw1ZZOi81mucepx2Cx515+B4zg JBI/C45fQ88ggrIk/4IkNhM7urP6tZv+LRyeS1Gu+e1OKGb1up070FsxQ3+gmb34Lqne snhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=8ECvSvwnlO1/znlsHftWuTD747kp/GTmvQSqCxYBQYE=; b=R0teCBWQm/dSV1WNcF9SYd1PVo3SBGMbhl2ob/YCOJnn284Rdaxvx7KCGVep8PR2+P ksrKvMlxvxIbD81erLfpUFaKSYexFoziaGQbWZeg7Bsqw1Zo1kem9g3ORoO2lhKgunEo WvMd+mHgGxNGnmws+G/cmwFCotul06MQ8LrRkm4u3gWsqFqzAoYIdh7EgfgSretalhTx NeSWrIqRoNPYKyJOHnNQRqqw2Te04tJEOom/4QrZ5ZhcmdzSbiiScl8YVYzFQm0lP6tB vG5k77yrRGsbNadjp1VDXBX2HtuYmoTW5/c326MPQ/8M9+aqjHjP8JOPEdvzwxl+vFXX RADA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si159278oij.136.2020.02.05.07.46.56; Wed, 05 Feb 2020 07:47:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727478AbgBEPpV (ORCPT + 99 others); Wed, 5 Feb 2020 10:45:21 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:35857 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbgBEPpQ (ORCPT ); Wed, 5 Feb 2020 10:45:16 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1izMrS-0004Qh-27; Wed, 05 Feb 2020 16:45:06 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id B03061C1EC4; Wed, 5 Feb 2020 16:45:05 +0100 (CET) Date: Wed, 05 Feb 2020 15:45:05 -0000 From: "tip-bot2 for Changbin Du" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf: Make perf able to build with latest libbfd Cc: Changbin Du , Jiri Olsa , Peter Zijlstra , Arnaldo Carvalho de Melo , x86 , LKML In-Reply-To: <20200128152938.31413-1-changbin.du@gmail.com> References: <20200128152938.31413-1-changbin.du@gmail.com> MIME-Version: 1.0 Message-ID: <158091750550.411.12440680363367163439.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 0ada120c883d4f1f6aafd01cf0fbb10d8bbba015 Gitweb: https://git.kernel.org/tip/0ada120c883d4f1f6aafd01cf0fbb10d8bbba015 Author: Changbin Du AuthorDate: Tue, 28 Jan 2020 23:29:38 +08:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Thu, 30 Jan 2020 11:55:26 +01:00 perf: Make perf able to build with latest libbfd libbfd has changed the bfd_section_* macros to inline functions bfd_section_ since 2019-09-18. See below two commits: o http://www.sourceware.org/ml/gdb-cvs/2019-09/msg00064.html o https://www.sourceware.org/ml/gdb-cvs/2019-09/msg00072.html This fix make perf able to build with both old and new libbfd. Signed-off-by: Changbin Du Acked-by: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200128152938.31413-1-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/srcline.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c index 6ccf6f6..5b7d6c1 100644 --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c @@ -193,16 +193,30 @@ static void find_address_in_section(bfd *abfd, asection *section, void *data) bfd_vma pc, vma; bfd_size_type size; struct a2l_data *a2l = data; + flagword flags; if (a2l->found) return; - if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0) +#ifdef bfd_get_section_flags + flags = bfd_get_section_flags(abfd, section); +#else + flags = bfd_section_flags(section); +#endif + if ((flags & SEC_ALLOC) == 0) return; pc = a2l->addr; +#ifdef bfd_get_section_vma vma = bfd_get_section_vma(abfd, section); +#else + vma = bfd_section_vma(section); +#endif +#ifdef bfd_get_section_size size = bfd_get_section_size(section); +#else + size = bfd_section_size(section); +#endif if (pc < vma || pc >= vma + size) return;