Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp639148ybl; Fri, 13 Dec 2019 02:12:54 -0800 (PST) X-Google-Smtp-Source: APXvYqxJcTlB2by6NY9zJ+ZjBJic30WtiWHZUEtgRWABeB4jM8WOyEFpDuiZhH8WVoUTR9+Fd+ws X-Received: by 2002:a05:6830:1188:: with SMTP id u8mr13892579otq.274.1576231974069; Fri, 13 Dec 2019 02:12:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576231974; cv=none; d=google.com; s=arc-20160816; b=qahGwXenIRv62RaF6jo5i55rEjPbhGZG+ytIMmmBrROv2+YpKleRI+5a25x4hlO7JB 2afi9iNe7xEch/J9ML2Mgdb7e+/CsoP4YW2/PGqR2vlT7gVX0v+q0/SxsJdbm+BOQK+m qHl/uOu1gNqOpKbIgUHJHgF4d+di1BUrEnwrvRNobxNAS+Zqx3DB553JMgdNSsYSJthG 40TiKChG9Gm1EcUE2S9rs7GrSmrw0FwhxYTecL9CMy5kSYkXt2GiusEs1c01/EHiPfpt nYMQYna0MxSDpqJ9QkW8E23woJQuwtOSVUuRvD0/gAslrLd6aG7b0q3xFWz0EcOy0y8d ksAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=//DSESvYzIrAMCHd0pJsVoMy2dJ3YvdUPPOGYoKJCdo=; b=pQKJVcqpcEAI5lBU5grhCrFigMFL9qKgcIn8coh0neRPmZHQ8d+wmZYAwuQeQCktpj T0DCQzK163+RGWEtQqf5RHjJ94+a9qRFmCNq8nyuid2CaFar2J6OqrLgnxkcFmoFmLEB Ys6+M45rJRGGsnCwO6hYKXlv34QrIpdEBy89Ugu2+suYoJqheLsUfW6R1j985kpdONo6 ToWfQEPiuyV/Tpc/TtKL+lWecMPAKqiNClsHK46m0bMilacOknQvOsJvmpDBNeS6DB99 vI4JSGa8MUQh8GqbhXC5Sej92tcsgF6ryLU247sJPSCbzHEC1aFqRhlYtFaPZjWL8RPY c2kw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s128si5113208oig.204.2019.12.13.02.12.42; Fri, 13 Dec 2019 02:12:54 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726740AbfLMKLe (ORCPT + 99 others); Fri, 13 Dec 2019 05:11:34 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:53834 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbfLMKLd (ORCPT ); Fri, 13 Dec 2019 05:11:33 -0500 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=calabresa) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ifhuv-00075h-Mp; Fri, 13 Dec 2019 10:11:26 +0000 Date: Fri, 13 Dec 2019 07:11:14 -0300 From: Thadeu Lima de Souza Cascardo To: Justin Forbes Cc: Daniel Borkmann , Song Liu , Andrii Nakryiko , Alexei Starovoitov , LKML , "open list:BPF (Safe dynamic programs and tools)" , Yonghong Song , "open list:BPF (Safe dynamic programs and tools)" , linuxppc-dev@lists.ozlabs.org, Martin KaFai Lau , Aurelien Jarno , debian-kernel@lists.debian.org Subject: [PATCH] libbpf: Fix readelf output parsing for Fedora Message-ID: <20191213101114.GA3986@calabresa> References: <20191201195728.4161537-1-aurelien@aurel32.net> <87zhgbe0ix.fsf@mpe.ellerman.id.au> <20191202093752.GA1535@localhost.localdomain> <20191210222553.GA4580@calabresa> <20191211160133.GB4580@calabresa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fedora binutils has been patched to show "other info" for a symbol at the end of the line. This was done in order to support unmaintained scripts that would break with the extra info. [1] [1] https://src.fedoraproject.org/rpms/binutils/c/b8265c46f7ddae23a792ee8306fbaaeacba83bf8 This in turn has been done to fix the build of ruby, because of checksec. [2] Thanks Michael Ellerman for the pointer. [2] https://bugzilla.redhat.com/show_bug.cgi?id=1479302 As libbpf Makefile is not unmaintained, we can simply deal with either output format, by just removing the "other info" field, as it always comes inside brackets. Cc: Aurelien Jarno Fixes: 3464afdf11f9 (libbpf: Fix readelf output parsing on powerpc with recent binutils) Reported-by: Justin Forbes Signed-off-by: Thadeu Lima de Souza Cascardo --- tools/lib/bpf/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index defae23a0169..23ae06c43d08 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -147,6 +147,7 @@ TAGS_PROG := $(if $(shell which etags 2>/dev/null),etags,ctags) GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \ cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \ + sed 's/\[.*\]//' | \ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \ sort -u | wc -l) VERSIONED_SYM_COUNT = $(shell readelf -s --wide $(OUTPUT)libbpf.so | \ @@ -213,6 +214,7 @@ check_abi: $(OUTPUT)libbpf.so "versioned in $(VERSION_SCRIPT)." >&2; \ readelf -s --wide $(BPF_IN_SHARED) | \ cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \ + sed 's/\[.*\]//' | \ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \ sort -u > $(OUTPUT)libbpf_global_syms.tmp; \ readelf -s --wide $(OUTPUT)libbpf.so | \ -- 2.24.0