Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1314136pxu; Mon, 23 Nov 2020 18:08:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUwHCcVcDT3otBudL+k3vHSNJqqv75ifa4kWDX/fq3IAzuQmc3NjwMADXzUQzZ+r46YX9H X-Received: by 2002:a17:906:4551:: with SMTP id s17mr2146658ejq.545.1606183703819; Mon, 23 Nov 2020 18:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606183703; cv=none; d=google.com; s=arc-20160816; b=I1nLD/RW3B+M69UaapC1uWrc/1vgrgnOu9vq7TWzMXo/H8UpLLWCi8Qat7++nMKXIZ PAblkQOsvSpi8fT2SXfaNGEkV2V/arVG6uDjvzJXgfzJdXc2Zfq53120xAlGPCdS4Kef QQ1FtCj4bXEOBVqnt29AAuWNNF28HYRoXCw2x2knosLZWhJRaSEawnngzrQryGfCgsfX 0/DZ0p+QwCDNCIEAZpM+cxEcNrzRNrhffDz9N+cmIohdBZPbrYa9NTpLHVcKWRLk5Y9x pJ5oI+JGR1sdaVNO7/prsvCrSm778sXNcy6hM+0yleDn/9713qp82YZQFrFqK1w3Jt6i QsIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uOP6qeqF2Gw6IZSbT36gK0uq6EIsohrivkkqY9NCMqI=; b=YUZwgsjzkx7c2QYd2U4crnhtQAumh2NdjEm3ThQ5CtYXcyn8RGb3e1gNzFhSoJNHO4 wpmpYw/Y9h/vvgtvQnsGZrbNVr9gOhVkFIKRnnpmS7YvLa9Q578zhG9XuJNuA2kpQIYu nw/mtGVbs50wPtUFHAAUJlXMBfJ613ZGBJrVpUSBC4z6ckGQrYc9gjGhyQJ6ArU315/j CSsmX28o6Vd7Zw5MSrNIfZITrOk8WIIsrWDCwZOLqfa7Xkrzl6+gBZwomCk+cAniyD6f x7HAjglxSZ9EglnIq59bxzZMWvlxXXuuTYktKzey8YVh5ZdBw1P6rXuZLsO9NDABSr5/ 9AVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FSlsuA9N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt13si7132857ejb.358.2020.11.23.18.08.01; Mon, 23 Nov 2020 18:08:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FSlsuA9N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388733AbgKWNIu (ORCPT + 99 others); Mon, 23 Nov 2020 08:08:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:33620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732850AbgKWMsp (ORCPT ); Mon, 23 Nov 2020 07:48:45 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 670BE20888; Mon, 23 Nov 2020 12:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135710; bh=K4QyVoNnllLtRru6GQBzKjCXb2dKaUP7i8gT6OpILvg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FSlsuA9N9MtPNMQrgNhPf9kpGChBncOLT1HB9UcAgdhG3HD+Dv4L6SEGtDPxIj16C P80nkdMAHimBdop1ruoTnrOBjAsOPxTcKENp2r0P9pUXu+bXj9umhFmdLaHO7ixdNr zrDvBzwpLLpR5rXcytP+7WpXPSjZqiK9v+mDjrJc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Olsa , Alexei Starovoitov , Andrii Nakryiko , Sasha Levin Subject: [PATCH 5.9 167/252] libbpf: Fix VERSIONED_SYM_COUNT number parsing Date: Mon, 23 Nov 2020 13:21:57 +0100 Message-Id: <20201123121843.652172408@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121835.580259631@linuxfoundation.org> References: <20201123121835.580259631@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Olsa [ Upstream commit 1fd6cee127e2ddff36d648573d7566aafb0d0b77 ] We remove "other info" from "readelf -s --wide" output when parsing GLOBAL_SYM_COUNT variable, which was added in [1]. But we don't do that for VERSIONED_SYM_COUNT and it's failing the check_abi target on powerpc Fedora 33. The extra "other info" wasn't problem for VERSIONED_SYM_COUNT parsing until commit [2] added awk in the pipe, which assumes that the last column is symbol, but it can be "other info". Adding "other info" removal for VERSIONED_SYM_COUNT the same way as we did for GLOBAL_SYM_COUNT parsing. [1] aa915931ac3e ("libbpf: Fix readelf output parsing for Fedora") [2] 746f534a4809 ("tools/libbpf: Avoid counting local symbols in ABI check") Fixes: 746f534a4809 ("tools/libbpf: Avoid counting local symbols in ABI check") Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20201118211350.1493421-1-jolsa@kernel.org Signed-off-by: Sasha Levin --- tools/lib/bpf/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 9ae8f4ef0aac2..8bf2c406b0e05 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -152,6 +152,7 @@ GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \ sort -u | wc -l) VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \ + sed 's/\[.*\]//' | \ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \ grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l) @@ -220,6 +221,7 @@ check_abi: $(OUTPUT)libbpf.so awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \ sort -u > $(OUTPUT)libbpf_global_syms.tmp; \ readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \ + sed 's/\[.*\]//' | \ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \ grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | \ sort -u > $(OUTPUT)libbpf_versioned_syms.tmp; \ -- 2.27.0