From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C379C433DF for ; Mon, 1 Jun 2020 18:43:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB57A207BB for ; Mon, 1 Jun 2020 18:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591037023; bh=a19FcwfSSh7wnaWKjzuYFYpJ5AhDmsleEPaVskEFUOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZjHKOhSMZnSnmCVoQ/PsFf5XC68DAApxDqolZ6kiSnFdLxQFhaNRYpDejgtwhvJwE Dd73HrUeNfn0fiDiImY0vl2O4aVmVjMKHT0R+HXwNEeigsG7h3La1yW20D4mq+wObK 1V6PORJUzOaEu4yZ6oLFuln2pz1FAJpGUcR4hvUU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbgFASnj (ORCPT ); Mon, 1 Jun 2020 14:43:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:58548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730206AbgFASLX (ORCPT ); Mon, 1 Jun 2020 14:11:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2AA9620825; Mon, 1 Jun 2020 18:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591035082; bh=a19FcwfSSh7wnaWKjzuYFYpJ5AhDmsleEPaVskEFUOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FipTByDp3AlL/vTbU1YI4vYweAobcQd/E5JWrzAWJRpmz73egcTD0+Ujod9NEx42q 0vEsxzLTq8k/w7z+hJazyB1PR/cfm5EP0lz889Tlp2AMqDRpiSaqqx55AfZPUycWIM F6YXr9tPuMvZRoNG1lkr3agQ/bS3x8W5uY5+v1mE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Changbin Du , Jiri Olsa , Peter Zijlstra , Arnaldo Carvalho de Melo , Marek Vasut Subject: [PATCH 5.4 142/142] perf: Make perf able to build with latest libbfd Date: Mon, 1 Jun 2020 19:55:00 +0200 Message-Id: <20200601174052.394180342@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174037.904070960@linuxfoundation.org> References: <20200601174037.904070960@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Changbin Du commit 0ada120c883d4f1f6aafd01cf0fbb10d8bbba015 upstream. 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 Cc: Marek Vasut Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/srcline.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c @@ -193,16 +193,30 @@ static void find_address_in_section(bfd 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;