Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7223868ybl; Wed, 15 Jan 2020 18:06:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyOxVuSW6xPcESae5pobYayvVI+GIyH81f+XjXaVYUCx8tCM2BU8qcMKSLdbtQNEj2sHW0I X-Received: by 2002:aca:5795:: with SMTP id l143mr2461869oib.27.1579140395965; Wed, 15 Jan 2020 18:06:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579140395; cv=none; d=google.com; s=arc-20160816; b=BCStam3+nm7qEBtBK+REGZ7g4QDZRgLeF20Rz50cpA3IJyCuSTvDUVeFZ4U9U5+8yD 4dGfFXSXz2e7Bclusu5kMXoj1vpiu+oqQ4qophY209RM69r1bo3wmBSOmPMUSqVVFU1n zRydW3Xg9QE5mdg0vHsDyKI4zzrNMj+96AP2cvjJt4TLZ+O5v37jUZEeCo+IpyoixEex V1x33ROddrgvEfdexqHg7KwsOKjVrzBR/+MNyISkQlr9+cQYjX7iJ9Jn7bHIBHwLaoNF SA40DDgfWRN8q1sftuNeDDfKbLYSDwp4Zfu//mAMPDpMdIAkKLZvG39e56q6VLBQyitA 7fSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:dkim-signature; bh=MBSVCoB4rQwimvdcO92dW2HOh3rjCYxrKhnOoS8UgoE=; b=LI023UsgK3/46zgWssOH0EOL5o5QpWZ5Kc5Cb1AeyERaqUEYphChZyczP1+EEGolYH y9TMOzoeyas5eKJFaMV0aIIyrvHsb4zvBuhHxHVTUAlEpNxx9LWF3Nw6G4JZjaybMhh7 nNv4sDSib1ffDJ+3kNsn0vB/OMEfHFzHnaPTGFTYXs5pxQ+0niA2/fdzSXaaim9PyuXt ulZ9S0Tp2iOm/37alfiDmYk7JcKbACxWjXXfRZ9n+aS1bdEbmgwbkYuQXJx+M2SVr8lv f96OL8+BhkNsgkuNh4pr5As2s03rDtKA9mvszk3tjAq9pnj59j0lW03cnGw3QKtOHpD1 ZUyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=B5o0Q+Qb; 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 18si10081401oir.123.2020.01.15.18.06.23; Wed, 15 Jan 2020 18:06:35 -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=@canb.auug.org.au header.s=201702 header.b=B5o0Q+Qb; 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 S1730503AbgAOXji (ORCPT + 99 others); Wed, 15 Jan 2020 18:39:38 -0500 Received: from bilbo.ozlabs.org ([203.11.71.1]:51827 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726472AbgAOXjh (ORCPT ); Wed, 15 Jan 2020 18:39:37 -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 47ykLs4sxMz9sR1; Thu, 16 Jan 2020 10:39:33 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=canb.auug.org.au; s=201702; t=1579131575; bh=bM+tz2kFdbTfR+m35IrApP9n+YHuTQq0hXIrBD1g6p0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=B5o0Q+Qbz+Fh9nE6jGV8mxlgxUvMrP7QnMN7U8rJQtga5PK4LN11cKBT/wLOLs4YP XuuAQ+Bsk3h7dQ/zO7fab/eJr7Cxr4uhtJBmsVRPA+PgjEJ/yxN53hXroCdOuOKYOI G7bcHeM5X2XLDhiLYdnIe0Axc0SBLxrU0i7U4WOHBcmlZY0kXD0cH0eJ+Lv/Y2HtlN qnJ8Vu/9spGH3FAwSo+F+6zs/eA2zf+UOzdgE8mt36GSlxCcpJs1KMdLt98Flz6JRN soQ0lm8kiGof8G9XlKjoX8QxuJzgqqnC47fhhJTpIaLHyzovjA8fUUdGyoLkFITU1E nE9c9dUXrF6Hw== Date: Thu, 16 Jan 2020 10:39:32 +1100 From: Stephen Rothwell To: Alexandre Ghiti Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Alexei Starovoitov , linux-next@vger.kernel.org, Zong Li , Palmer Dabbelt Subject: Re: [PATCH] powerpc: Do not consider weak unresolved symbol relocations as bad Message-ID: <20200116103932.2e603cf9@canb.auug.org.au> In-Reply-To: <20200115204648.7179-1-alex@ghiti.fr> References: <20200115204648.7179-1-alex@ghiti.fr> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/X0ES/Pzabz50rIWcgod6J4G"; protocol="application/pgp-signature"; micalg=pgp-sha256 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/X0ES/Pzabz50rIWcgod6J4G Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Alexandre, Thanks for sorting this out. Just a few comments below. On Wed, 15 Jan 2020 15:46:48 -0500 Alexandre Ghiti wrote: > > =20 > # Have Kbuild supply the path to objdump so we handle cross compilation. ^ "and nm" > +# Remove from the bad relocations those that match an undefined weak sym= bol > +# which will result in an absolute relocation to 0. > +# Weak unresolved symbols are of that form in nm output: > +# " w _binary__btf_vmlinux_bin_end" > +undef_weak_symbols=3D$($nm "$vmlinux" | awk -e '$1 ~ /w/ { print $2 }') > + > +while IFS=3D read -r weak_symbol; do > + bad_relocs=3D"$(echo -n "$bad_relocs" | sed "/$weak_symbol/d")" > +done <<< "$undef_weak_symbols" This is not a bash script, and the above is a bashism :-( Also, my version of awk (mawk) doesn't have a -e option. How about something like : undef_weak_symbols=3D$($nm "$vmlinux" | awk '$1 ~ /w/ { print $2 }') if [ "$undef_weak_symbols" ]; then bad_relocs=3D"$(echo "$bad_relocs" | grep -F -w -v "$undef_weak_symbols")" fi Or do this near the top and add the grep to the others. --=20 Cheers, Stephen Rothwell --Sig_/X0ES/Pzabz50rIWcgod6J4G Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAl4forQACgkQAVBC80lX 0GyunwgAkZoBTpQAhgoODm6QrksXXQEyfUW4a4mYnW8Q62gQraQoNVv0H9M1Irnu 1W7s/FfgvSNAom/ST78bdY0mPdADH0TZmyyRJbv2EIYvnwUdXva5UwAboMLCacnW PZKeC8ox9F57/Td+tDK7okuk/uO17KKp+Uo70DeDeS2i8KUZyUJxD+mO7y173pUj hNt25ESQEqrC4Lvu9I16kyLjxvjzMRv4unaQIy3htYQCbxF7/X1Lu33FEhvAJ9vx 4BY7VWCaE2KNUMEaupSvJiXKfKWWGw6uMNZysIM17C5CfdHZvhaeMNYjNq03A6tX jalLi/Ycc9raelW8W8CmcuHx5CzvDA== =q+Te -----END PGP SIGNATURE----- --Sig_/X0ES/Pzabz50rIWcgod6J4G--