Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5756795ybl; Tue, 10 Dec 2019 11:00:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwmeU0hA9E9ay/4o7MCqOCxkvRVOkXralWdT93vs38VtKb2cwAeDHswyLQhjsJCypyFdIKw X-Received: by 2002:a54:4518:: with SMTP id l24mr276275oil.41.1576004432894; Tue, 10 Dec 2019 11:00:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576004432; cv=none; d=google.com; s=arc-20160816; b=LviTDD2dXwg0QAPwBE8SCH4g1NgCtmMqoVH1d8I5ACgdU6KzJNVidDEF+3wbTmYFb3 gHCU2/y7jaPu2k3vQmlLvnF9iQIrDpnuhdtSbugXEnOgYVC2YzAa9pzTHnDEO2XyaBlF fubXjFuabzqIeJnAwlI57plhXpleYbOAQ/RiG482y7MwmPHMRGnSsEuHJ3nWQCLDjvGj Of0LLlt255AK7wny74vWNu7DxOyf5p6XLY+OLa5p2avZ9m8Ol/UahsxrCWfQvuRIngww jwDPTcfXVbrn6+UcIZcgXLx3plOJJcZn/TtbzSUGSEDh/Ee/0fRe6qTMUjwBbSoNQQRf 7ZtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CvDFARgCT0LsrZ/bz1Y3KZ6G13ajYy+ecdz2Y5wO+o4=; b=tJrolzN6LWFhle/HvwOztz32uDrbDerxSx2gMEFSbgiaxkGHyaTJrVSohYF4U0ZsQE l8+4vAes4rHmfXB+sN2Z7s1hyAJlcKf42vsQLAw449b2DA7a77TZU9FmOKUB+DJbERKi CEow/qzKBIIQnxdvK13KDMfXym/kbFR3Zes2SG+5mSOeaQgmSAKq5HL73HfRD0Q/sCYP sPsBA4f7nHCVMRshkJpaF01+HhqSjSFTLpKSvkTUrow0rgWEbODivefphcNjWEg23+Vf imcN7/28X8hDNjR8wRxMKfIsWmSuljGRTkw68kWAboN5j6t1Q15sNvDciZU/Ei5/YPcP dByg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxtx.org header.s=google header.b=JogH2eZ4; 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 z3si2182214oib.164.2019.12.10.11.00.20; Tue, 10 Dec 2019 11:00:32 -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=@linuxtx.org header.s=google header.b=JogH2eZ4; 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 S1727716AbfLJS6q (ORCPT + 99 others); Tue, 10 Dec 2019 13:58:46 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54627 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727495AbfLJS6q (ORCPT ); Tue, 10 Dec 2019 13:58:46 -0500 Received: by mail-wm1-f66.google.com with SMTP id b11so4439491wmj.4 for ; Tue, 10 Dec 2019 10:58:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxtx.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CvDFARgCT0LsrZ/bz1Y3KZ6G13ajYy+ecdz2Y5wO+o4=; b=JogH2eZ4Nhc/g73QDo4a7CNVK2d54Ay5JJclQzZ2XGAoWhHww28c40KZpbDE3OUs5Q LxqLakbePfjaWEZtzW9qE+6VQDXz+12h9Gbqxe5ZfzfSK4AhbV5cmsUWIltiNmsHHtcx hIg67qr9XGmb/1o5Dd+/k1/D7ovJBZmSfJPdE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CvDFARgCT0LsrZ/bz1Y3KZ6G13ajYy+ecdz2Y5wO+o4=; b=b9Yt+OTDasUWHd8eEO/mAPXnksR4OP16Wm+yWHlITqzSs9G2FN2MOIHEkWNh6+HH1m xxX3VqINGJK17LsY/i9grLF0gWDmB5mKOdEmfPQ/ubR+uljuRH0QrfPrtc+3ofw3agvt NyE3AQFzUOUp8uH46BQ4I5b1MVjMYRRQPB6FMgPtyDR9kTZzpIDon367s4IM2Zg/TsTT UQ0H1ZJ8D7md8ryPN39z5v8QEaWzDglDJPMotf3t3qKSrpif0K41R7yNEjBCyJNxTGM2 RBhsYUADVdVvaUSTSsLys3KyVeN/fttY1c8xBIbdtbGgpibCSngXPzNil6qAN8hPMO87 OdOA== X-Gm-Message-State: APjAAAVVpakiqS9wNPUMz0RjVk8jYyMI4n0/lU/PhBWuVKBgIYyCVe1j BbWhJ1OeavUrQN+xet/R3GcnbOPlwKXWXsFcpDWjtA== X-Received: by 2002:a1c:7310:: with SMTP id d16mr6679056wmb.165.1576004324170; Tue, 10 Dec 2019 10:58:44 -0800 (PST) MIME-Version: 1.0 References: <20191201195728.4161537-1-aurelien@aurel32.net> <87zhgbe0ix.fsf@mpe.ellerman.id.au> <20191202093752.GA1535@localhost.localdomain> In-Reply-To: <20191202093752.GA1535@localhost.localdomain> From: Justin Forbes Date: Tue, 10 Dec 2019 12:58:33 -0600 Message-ID: Subject: Re: [PATCH] libbpf: fix readelf output parsing on powerpc with recent binutils To: Daniel Borkmann Cc: Michael Ellerman , Aurelien Jarno , LKML , linuxppc-dev@lists.ozlabs.org, debian-kernel@lists.debian.org, Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , "open list:BPF (Safe dynamic programs and tools)" , "open list:BPF (Safe dynamic programs and tools)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 2, 2019 at 3:37 AM Daniel Borkmann wrote: > > On Mon, Dec 02, 2019 at 04:53:26PM +1100, Michael Ellerman wrote: > > Aurelien Jarno writes: > > > On powerpc with recent versions of binutils, readelf outputs an extra > > > field when dumping the symbols of an object file. For example: > > > > > > 35: 0000000000000838 96 FUNC LOCAL DEFAULT [: 8] 1 btf_is_struct > > > > > > The extra "[: 8]" prevents the GLOBAL_SYM_COUNT variable to > > > be computed correctly and causes the checkabi target to fail. > > > > > > Fix that by looking for the symbol name in the last field instead of the > > > 8th one. This way it should also cope with future extra fields. > > > > > > Signed-off-by: Aurelien Jarno > > > --- > > > tools/lib/bpf/Makefile | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > Thanks for fixing that, it's been on my very long list of test failures > > for a while. > > > > Tested-by: Michael Ellerman > > Looks good & also continues to work on x86. Applied, thanks! This actually seems to break horribly on PPC64le with binutils 2.33.1 resulting in: Warning: Num of global symbols in sharedobjs/libbpf-in.o (32) does NOT match with num of versioned symbols in libbpf.so (184). Please make sure all LIBBPF_API symbols are versioned in libbpf.map. This is the only arch that fails, with x86/arm/aarch64/s390 all building fine. Reverting this patch allows successful build across all arches. Justin