Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp281809ybl; Tue, 28 Jan 2020 23:59:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwgFMB7Wrm3wT6Ticc6cJ0JKf97+KYdl1IYpLpNw/czFca3QPO1H/TO5/mzq5/fhfJG52Qe X-Received: by 2002:a9d:518b:: with SMTP id y11mr18612202otg.349.1580284786973; Tue, 28 Jan 2020 23:59:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580284786; cv=none; d=google.com; s=arc-20160816; b=YOnhFe8nIXAy2JwAo9Nlp5KtIMnfIVAr/CEbyLgzToa8KywdCB75XXycPwf91GNG7a +IoBj9tW1MhoitEL13J31uXff32UY3fUwDIaI02OyX8a/qwXzUrAwIyPFxGskWEF+VZ5 PjukoFGaEDMvJInpaoNvTP3/o22XjnSZK9nU5DGJDkcl73Of76PtSzrcU6XlFB99JdhK m30hS5jXj5UDLz+RhE8C9JaYJRLNyvm355OUSvFnFEBD69KSg9Yq3FgDVZ4KahL2eVX1 W9L1JJBdv3JRd99X+YLGVYtLTpDCntrsnluAmL6hsZtLdYM3LAIIflQSjgDbNOnBfRua ohEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gHk1aL7hxo7ZoRJFzbI0fjtox7s7pKir+bxT3CuVjSA=; b=nuxn4p0D3KFnAADO0iuMYYRI9kXfsm22n1yWu7RA110DJEHpuewWeNjnKCEFsfVYVi L5/JsFD25IJYoNlTZXy4n0Qn0etYhKN6jCjd54NShfU79Aeno16xsNYGHBQpu/eDTxde YJun+RB3u4IVAlbiffI0dz1T8Afy+Q0JIgnbrBP004mT6ZOO8K3wm+EIs8WJ03gB9wKJ o6aJCTrHBOjPDjFkcRm3PiSClvdCN7jxuys/oAtPDbwz8jC4EwkYZ749ZB4ccbj5wUZu T2AlUNd7ph1FKfVtoF3hrbfmGapiNVbn9TeIIyTptSMoLpCsRBy2Q1upfV8LLP2dTsZO eEPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RKnTYTdS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9si779636otq.68.2020.01.28.23.59.34; Tue, 28 Jan 2020 23:59:46 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RKnTYTdS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726140AbgA2H6m (ORCPT + 99 others); Wed, 29 Jan 2020 02:58:42 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:40602 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726068AbgA2H6l (ORCPT ); Wed, 29 Jan 2020 02:58:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580284720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gHk1aL7hxo7ZoRJFzbI0fjtox7s7pKir+bxT3CuVjSA=; b=RKnTYTdSu7ib1lp9lsJ9kt6TRO2BCP7VmlGImSdNbeuiPOM8v80m1c6GBYPYV7zEfVFZBu XJ+Urab/v4PrCFCbRDifBD9GrvE/3zzyITSf07gQpOUPr/LQlAdUpwbz1QgBQi3Vz9nDuA TX6WabO8uNehkFmnXZ0+vYcjQJOoPsc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-12-_gYidbK1Nfi2dGIEd0p8WA-1; Wed, 29 Jan 2020 02:58:33 -0500 X-MC-Unique: _gYidbK1Nfi2dGIEd0p8WA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8C9B184BBD3; Wed, 29 Jan 2020 07:58:32 +0000 (UTC) Received: from krava (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B555D10018FF; Wed, 29 Jan 2020 07:58:31 +0000 (UTC) Date: Wed, 29 Jan 2020 08:58:29 +0100 From: Jiri Olsa To: Changbin Du Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: Make perf able to build with latest libbfd Message-ID: <20200129075829.GB1256499@krava> References: <20200128152938.31413-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200128152938.31413-1-changbin.du@gmail.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 28, 2020 at 11:29:38PM +0800, Changbin Du wrote: > 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 thanks, jirka > --- > 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 6ccf6f6d09df..5b7d6c16d33f 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; > -- > 2.24.0 >