From patchwork Thu Aug 6 09:05:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 11703045 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78FCB138C for ; Thu, 6 Aug 2020 12:01:21 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CE6522D05 for ; Thu, 6 Aug 2020 12:01:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CE6522D05 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k3bpt-0008BA-Ba; Thu, 06 Aug 2020 09:05:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k3bps-0008B2-9j for xen-devel@lists.xenproject.org; Thu, 06 Aug 2020 09:05:16 +0000 X-Inumbo-ID: 30b871ee-f5b2-49bf-980a-550ffac0fff5 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 30b871ee-f5b2-49bf-980a-550ffac0fff5; Thu, 06 Aug 2020 09:05:15 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 12D80AC50; Thu, 6 Aug 2020 09:05:32 +0000 (UTC) Subject: [PATCH 2/4] build: correctly report non-empty section sizes upon .o -> .init.o conversion From: Jan Beulich To: "xen-devel@lists.xenproject.org" References: <305c2532-408a-9f78-61fe-c90a2e86eb8e@suse.com> Message-ID: <5fcb47ec-4a0e-99a2-c548-f42ec1cc8030@suse.com> Date: Thu, 6 Aug 2020 11:05:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <305c2532-408a-9f78-61fe-c90a2e86eb8e@suse.com> Content-Language: en-US X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The originally used sed expression converted not just multiple leading zeroes (as intended), but also trailing ones, rendering the error message somewhat confusing. Collapse zeroes in just the one place where we need them collapsed, and leave objdump's output as is for all other purposes. Fixes: 48115d14743e ("Move more kernel decompression bits to .init.* sections") Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -185,11 +185,11 @@ cmd_cc_o_S = $(CC) $(a_flags) -c $< -o $ quiet_cmd_obj_init_o = INIT_O $@ define cmd_obj_init_o - $(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p;}' | while read idx name sz rest; do \ + $(OBJDUMP) -h $< | while read idx name sz rest; do \ case "$$name" in \ .*.local) ;; \ .text|.text.*|.data|.data.*|.bss) \ - test $$sz != 0 || continue; \ + test $$(echo $$sz | sed 's,00*,0,') != 0 || continue; \ echo "Error: size of $<:$$name is 0x$$sz" >&2; \ exit $$(expr $$idx + 1);; \ esac; \