Received: by 10.213.65.16 with SMTP id m16csp129876imf; Sun, 11 Mar 2018 19:42:03 -0700 (PDT) X-Google-Smtp-Source: AG47ELtLd1rFOfN1yc83fqwpkYRL5O1gGvxqErA4W0kk054IBD5J70VX5AdW0oRMC4RlQHRLtcJu X-Received: by 2002:a17:902:8a89:: with SMTP id p9-v6mr6607189plo.379.1520822523407; Sun, 11 Mar 2018 19:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520822523; cv=none; d=google.com; s=arc-20160816; b=dWuvZN8ZAxRx7gCtiv3Bd05QV0wmdtbMoviF7HGXSkKovGfocUnEN5Iw/HqrGW8jeZ ski/gBvP2zt9qxFRN2J89nBNosCdWi9MJeBGDlfIUROcPr8Hn7HtRSCwJ1YcdJbCbuEO YBHRY3tTrn443KaJ4OWlR2yhqrKmlIFXikjpEKK2nvUFMLoKk9Y8SPoRNSX7YNSxVS83 p1/+OAIowSpZPIHnu9MC4c86OZn5DLF3caTsSTPvKkz/pVhed9q5A6zSGgAUJr5LuWYK tNcboXvm36h7hdwGdFus1cR5DjcitH7vv5Tgi7b/E+eAanaTeN9dxf6cutZhUeiTSGZ7 YmGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Shz+GrM86ojm0C6PefVAfx9CK1SG6+l89RfQHPjKnaM=; b=TYWysljU0Y5Z/azkOCFLcOXr6dRUsKOigu0YljH7G6uNKnVnkWMxNxozlMdHuHCY3Z 9mqnYY/RoShm6AbJIlRju+prX8PjdlWzieYyv4TxRHb0RakIoQL8rRtyksfShnZG33Lv PPlbz7EWhmf2B6cI8h+3Nh6E+iZuIZMx4IGcmGqOMeQSOlLZRHhJ6b1oNtzAvnAAfb+B L53aYNVsEzyZ5gkVrXIWleT0bJnX3ibQl3zuQyh6Xe93ST3+wDoK1s9GrFdM0BARO1Zx duhd3OV1BOXEExkED7d66uPgSBAVaBmrPgaKGNLtOHY3AtcaGa+aJI0lGXnJbrEtnjRb lPHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jZb5dTWU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n68si4341121pgn.336.2018.03.11.19.41.48; Sun, 11 Mar 2018 19:42:03 -0700 (PDT) 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=@linaro.org header.s=google header.b=jZb5dTWU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932526AbeCLCk5 (ORCPT + 99 others); Sun, 11 Mar 2018 22:40:57 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:37812 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932443AbeCLCk4 (ORCPT ); Sun, 11 Mar 2018 22:40:56 -0400 Received: by mail-qt0-f195.google.com with SMTP id a23so5929982qtm.4 for ; Sun, 11 Mar 2018 19:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=Shz+GrM86ojm0C6PefVAfx9CK1SG6+l89RfQHPjKnaM=; b=jZb5dTWUx8L3MjhUCQu8PObT49BwSncpBugrFUmUpzpDbTnW1PkGhgmHwPgI0mSXqk qWqa40jCZT++y5nFlPn/0dS5YfHiBl/9Lnpwz7G4aDSmjT7Chn8EIBrh21XE6EcMaPTo HrPiZ5UhVMOgEo6Vocest6ERSWznqSjkeSWmQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=Shz+GrM86ojm0C6PefVAfx9CK1SG6+l89RfQHPjKnaM=; b=GRAvDo9euYf9lj6kmYl3CYRac43t5pkXIj40o11ll4rLlVMG3dDzb8w77I/iK7CnV0 NFeeMXKTS2plgMIONKGr0W+KcSvRepk6JEXn3MGzGJlVcYzNcnLkyZb+4speKGoGmKas vYZtvnGP3gB6USR9BhOL79wRu1yYpnAJcYO/mKbblQG67QvB+ESIt6QkDbgT7OmuB0Yb Ye5Gbu4UL4uYC9IH+FZ1b3HNgch/PYcw/shRvl9pufddUf2CskyxQonwYHlV3S5QMvD2 WAdKZrSdJJ9WgvDE0RyHB3MWJxoW0aMgYeo6brDZgIWPz0IwuI9pJLFvHkp0a8Vne9Oe F02Q== X-Gm-Message-State: AElRT7FN5K9jMlpSRCTY3t26xaB+JCtK3gxOPNMVxc59Qr1Gq1hFdX4c OUfV1Bha+WuHdZHUMEhg1uvagEyfZoY= X-Received: by 10.237.63.26 with SMTP id p26mr703234qtf.104.1520822455263; Sun, 11 Mar 2018 19:40:55 -0700 (PDT) Received: from xanadu.home (modemcable228.104-82-70.mc.videotron.ca. [70.82.104.228]) by smtp.gmail.com with ESMTPSA id c13sm4348593qth.97.2018.03.11.19.40.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Mar 2018 19:40:54 -0700 (PDT) Date: Sun, 11 Mar 2018 22:40:53 -0400 (EDT) From: Nicolas Pitre To: Arnd Bergmann cc: Andi Kleen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] ARM: disallow combining XIP and LTO In-Reply-To: <20180220215954.4092811-2-arnd@arndb.de> Message-ID: References: <20180220215954.4092811-1-arnd@arndb.de> <20180220215954.4092811-2-arnd@arndb.de> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Feb 2018, Arnd Bergmann wrote: > This fails during deflate_xip_data.sh > > /home/arnd/cross-gcc/bin/arm-linux-gnueabi-objcopy -O binary -R .comment -S vmlinux arch/arm/boot/xipImage && /bin/bash -c '/git/arm-soc/arch/arm/boot/deflate_xip_data.sh vmlinux arch/arm/boot/xipImage || { rm -f arch/arm/boot/xipImage; false; }' > make -f /git/arm-soc/scripts/Makefile.modpost > + sym_val __data_loc > + sed -n / __data_loc$/{s/ .*$//p;q} > + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux > /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe] > + local val=ac74c0f4 > + [ ac74c0f4 ] > + echo 2893332724 > + __data_loc=2893332724 > + sym_val _edata_loc > + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux > + sed -n / _edata_loc$/{s/ .*$//p;q} > /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe] > + local val=ac7b8744 > + [ ac7b8744 ] > + echo 2893776708 > + _edata_loc=2893776708 > + sym_val _xiprom > + sed -n / _xiprom$/{s/ .*$//p;q} > + /home/arnd/cross-gcc/bin/arm-linux-gnueabi-gcc-nm vmlinux > /home/arnd/cross-gcc/lib/gcc/arm-linux-gnueabi/8.0.1/../../../../arm-linux-gnueabi/bin/nm terminated with signal 13 [Broken pipe] > > Obviously we want to make the combination work, no idea why it doesn't. Well, it does work regardless of the noise. Here the nm output is piped into sed, and the later exits early when it finds what it is looking for, causing nm to complain about the broken pipe. Here's a patch silencing this bogus error message and fixing other minor issues. ----- >8 Subject: [PATCH] ARM: deflate_xip_data.sh: minor fixes Send nm complaints about broken pipe (when sed exits early) to /dev/null. All errors should be printed to stderr. Don't trap on normal exit so the trap can return an error code. Signed-off-by: Nicolas Pitre diff --git a/arch/arm/boot/deflate_xip_data.sh b/arch/arm/boot/deflate_xip_data.sh index 1189598a25..5e7d758ebd 100755 --- a/arch/arm/boot/deflate_xip_data.sh +++ b/arch/arm/boot/deflate_xip_data.sh @@ -30,7 +30,7 @@ esac sym_val() { # extract hex value for symbol in $1 - local val=$($NM "$VMLINUX" | sed -n "/ $1$/{s/ .*$//p;q}") + local val=$($NM "$VMLINUX" 2>/dev/null | sed -n "/ $1\$/{s/ .*$//p;q}") [ "$val" ] || { echo "can't find $1 in $VMLINUX" 1>&2; exit 1; } # convert from hex to decimal echo $((0x$val)) @@ -48,12 +48,12 @@ data_end=$(($_edata_loc - $base_offset)) file_end=$(stat -c "%s" "$XIPIMAGE") if [ "$file_end" != "$data_end" ]; then printf "end of xipImage doesn't match with _edata_loc (%#x vs %#x)\n" \ - $(($file_end + $base_offset)) $_edata_loc 2>&1 + $(($file_end + $base_offset)) $_edata_loc 1>&2 exit 1; fi # be ready to clean up -trap 'rm -f "$XIPIMAGE.tmp"' 0 1 2 3 +trap 'rm -f "$XIPIMAGE.tmp"; exit 1' 1 2 3 # substitute the data section by a compressed version $DD if="$XIPIMAGE" count=$data_start iflag=count_bytes of="$XIPIMAGE.tmp"