Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp425869ybl; Fri, 31 Jan 2020 01:20:38 -0800 (PST) X-Google-Smtp-Source: APXvYqyOpROqXZHQieG3jjEQjPv2sA/24NITLS/4yGgTp/mRFjuO49uk76oE1EVUgkfIQVjM0Syj X-Received: by 2002:a9d:ee2:: with SMTP id 89mr6665598otj.270.1580462438518; Fri, 31 Jan 2020 01:20:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580462438; cv=none; d=google.com; s=arc-20160816; b=m2ylEcaA1Z1KpNlhGuYtzMWqeqa5DzjeTy2KutcKpVDcjONWjwLmxqSJjta6i054ti tmQObZdYKN7sxJoOlBT2U4zYwm3eWFjlRVZa5piYE2tYXo7tELoTIUwff02ZvsjUgfD1 WPlG0JjbNrYJnRBOJzTbL8bGV64TteR5kxaoFVp5osoEsWnnvx5TrpJ90kmbJ4VM8D4M m9xKY6wFSpd1brQxPSLmDyIiQ3y8HyUzKNo2vjOjM8e3QrFX2qxyWXpx6/XgkKUvz0Q2 u6mzZ1cr6/5TsQpfQstXXy9QHj6u73OZtYwKUOOURNRFkAI1bg865uLteYBMihrzIUyh yCcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=2F4p9HyPOvz60gLxMQ802Z/MYBUnhTraYGKSoHOrjA4=; b=L6ktakYzYY4J0Vw1ZFmNOmp2XL31nnnmOv700909Z7eiB6V/W9C29QIb5JGsjIvxwS ZBKrALX8lg0GEi9kq/kUGhj508BxtLOlUphHl8B11e7h/D8Gn7+OmsOjbbagSvc6iU6E 0JW/353fFOnQN2tB6TNb/cQ5NbvpkLHZOlozNah4nHJ6D3Z7dJ//EybXSzDH9YhUWLsx U3rUD3Xbt9LgDKz/hliKEHObo9goM6FNfKsz8UYBdrBuiJ/tjwiDM/ED6QqCNpWKYAH2 Ay6rTatucafa9I+vEUuqU3dup0SlVNdI6GXFXbJ3afKk4eOioii47VYrIP0zer3M5Ug9 YWMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=mBhwEQHD; 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 l14si4200168oii.37.2020.01.31.01.20.26; Fri, 31 Jan 2020 01:20:38 -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=@ellerman.id.au header.s=201909 header.b=mBhwEQHD; 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 S1728238AbgAaJSc (ORCPT + 99 others); Fri, 31 Jan 2020 04:18:32 -0500 Received: from bilbo.ozlabs.org ([203.11.71.1]:54641 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728159AbgAaJSb (ORCPT ); Fri, 31 Jan 2020 04:18:31 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 488BTw54LNz9sRR; Fri, 31 Jan 2020 20:18:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1580462309; bh=cCI4WreJl9TPaQKBLWhchJurIy1jFBvqbedUEJxwYO0=; h=From:To:Subject:In-Reply-To:References:Date:From; b=mBhwEQHDz1XN3CYCwbbKhv0GeXIMwF6PpEKmhsU6baEkq/O5znNz1kxwO04DdH2cV cQHk2ukvWfkffBL51JWySB3i6n7Xl7+K7RF1CR+iQJlUb4nIovevkPsf/8IiWcXORj GnpcWStMenr/9iLqB+KmRYUxsIRmXjpWUw5hp3ZUkzSpP5jJKbtBG4k1xfmDmVRV+b DxTrd/E5w6IIfyo7oKOaCcXqhx0VhKUuGDld1R6qNtw50PBEprXULq816EfAofOTaJ iSMjmoBQSKBOxBN5hak7fA5eN3jYxhDXL/fQxIQu/+805iAC1oUuQmmADCj4gw1uOq PWLBEBWRkYeDw== From: Michael Ellerman To: Alex Ghiti , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Stephen Rothwell , Alexei Starovoitov , linux-next@vger.kernel.org, Zong Li , Palmer Dabbelt Subject: Re: [PATCH v2] powerpc: Do not consider weak unresolved symbol relocations as bad In-Reply-To: <8a8d45c6-4ad2-c682-abfb-3d97188d0d45@ghiti.fr> References: <20200118170335.21440-1-alex@ghiti.fr> <8a8d45c6-4ad2-c682-abfb-3d97188d0d45@ghiti.fr> Date: Fri, 31 Jan 2020 20:18:25 +1100 Message-ID: <87wo98f0gu.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alex Ghiti writes: > On 1/18/20 12:03 PM, Alexandre Ghiti wrote: >> Commit 8580ac9404f6 ("bpf: Process in-kernel BTF") introduced two weak >> symbols that may be unresolved at link time which result in an absolute >> relocation to 0. relocs_check.sh emits the following warning: >> >> "WARNING: 2 bad relocations >> c000000001a41478 R_PPC64_ADDR64 _binary__btf_vmlinux_bin_start >> c000000001a41480 R_PPC64_ADDR64 _binary__btf_vmlinux_bin_end" >> >> whereas those relocations are legitimate even for a relocatable kernel >> compiled with -pie option. >> >> relocs_check.sh already excluded some weak unresolved symbols explicitly: >> remove those hardcoded symbols and add some logic that parses the symbols >> using nm, retrieves all the weak unresolved symbols and excludes those from >> the list of the potential bad relocations. >> >> Reported-by: Stephen Rothwell >> Signed-off-by: Alexandre Ghiti >> --- >> >> Changes in v2: >> - Follow Stephen advice of using grep -F instead of looping over weak symbols >> using read, patch is way smaller and cleaner. >> - Add missing nm in comment >> >> arch/powerpc/Makefile.postlink | 4 ++-- >> arch/powerpc/tools/relocs_check.sh | 20 ++++++++++++-------- >> 2 files changed, 14 insertions(+), 10 deletions(-) >> ... > > Hi guys, > > > Any thought about that ? > > I do think this patch makes the whole check about absolute relocations > clearer. > And in the future, it will avoid anyone to spend some time on those > "bad" relocations > which actually aren't. Sorry I missed the v2. Will pick it up. cheers