Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp942039lqj; Mon, 3 Jun 2024 05:55:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUBcHjh6sbzmW36VGnBJkIskWc6W2KkUEx7/l+NU3LVgu3q91GJLRuv+BCREwNloVCV+GtQTxFaTXYATzVZ47vA1+N1tdggf3ImdMNPTg== X-Google-Smtp-Source: AGHT+IFIJbOfzyTYIe8Qcb03VW5tW7/Mb8h0RHFZP7bbwCvW4U/EdHfjBEbLS8aYA2UWs7xS1iRk X-Received: by 2002:a17:906:4691:b0:a68:e5c8:4266 with SMTP id a640c23a62f3a-a68e5c843efmr289691966b.43.1717419355820; Mon, 03 Jun 2024 05:55:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717419355; cv=pass; d=google.com; s=arc-20160816; b=S/OQGj9nObf7XHN0SycEdYb0jmwKdcez6TSHHQ3gZ6z0h2P4h/g3ZV8BhlotnoWegY gi83XQoxCoZNx1k+6h2jA1dA+16A6PCwNgXWTrnnJLTV/wLuecjMtQ80aCyq2jCFm3+5 nvIyC1+8R1kNlvx/hVcEzGHhX41R3C4nTyLFpoQaTJqgCdnPsy9X6wZDOPddMbqRm6Ws ASLQXzV6i45fMTrEek8T2DMcGk0+1v7zB/20a656ppBfOnHK2mGSlLGpH+SMk+ZiVDgb /Vda/iez33ncxM5RFaWTLCns9CTVKuaUYMK7DpOEVyYAp8WjFj6BrqAoUThm3wf5oCim wA3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=4ek9/9jyS/6GBjo8VMJicoTDciuFk9/lqcYpFzQARSM=; fh=BR4R7E4k1ivyZVd7cFgfIGytKvZhtU+LpQCNjy46mbE=; b=M9k2gja85wg8DYOuk5ndMDk3ecL40vnRX8dlUnCEVm24Rn5X1IdWWO/5LPhFOcjZrK E+cf+NneCsy3Zbl0zBilKHvP9QNHAX3etG1Mnn8DkQM38+LMkqC5PBG9DfJybc4S5wdv XCKK7EzsQu7/pDkfBKxA2hQeaG9f249LJ37A1HRRIW0NVoAni64cRN3B9BNK2xPsP5FR fEgHIl4CBkC7+j2rUHU39IaDpWwsQBkr8X5a+2bPJifwmyH7DGJtqP5JGYs5V9SALDry mYGZOI30nmW7szXNFirrIoWPu3wNG3NxzmsQm+GPBx6hymlfafyGZGactLbJXaICO+rm SRog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-199146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68c5fad6d6si241416866b.1018.2024.06.03.05.55.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 05:55:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-199146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 44B9D1F23E63 for ; Mon, 3 Jun 2024 12:55:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A7C212CDBE; Mon, 3 Jun 2024 12:55:35 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5397012C816 for ; Mon, 3 Jun 2024 12:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717419334; cv=none; b=KsB0PbSBEamkNznerRODxaiOs6MUbpn34tIy+CrSIUMQjRsOWQ12tUWYDPaOAExRNp9y/duwT8jCFsyf9b/8HaqlIQEBorJeKZLVdMXZb397OswVXn4hnXXPbXBezfLf6n1DW1BuGR23k8opFMO4YGR3hUQHypm3g7377pgHJ/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717419334; c=relaxed/simple; bh=zWe5whA25T5TVE2QuwRPt+5WNEG45lktcBKkrxyPjRc=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=jAqVoblzP0eRnlQANJsXWm87Mt/iiJbKeOR+nVT3L34VfXmzR2OSV0FqENQsaEvzB21QOKGSAPe9PEl5JRKjrx28yOWgGgZDik8/Sph49dJCwEfvFJGY8YI31eu4KhM6YhxCO4S5lRNMrz/BBJFtcW+23rqnIZA2O5rMlfpmprw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VtDBH746Mz1S98Q; Mon, 3 Jun 2024 20:51:35 +0800 (CST) Received: from dggpemd100004.china.huawei.com (unknown [7.185.36.20]) by mail.maildlp.com (Postfix) with ESMTPS id EE43A140382; Mon, 3 Jun 2024 20:55:14 +0800 (CST) Received: from [10.67.109.211] (10.67.109.211) by dggpemd100004.china.huawei.com (7.185.36.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Mon, 3 Jun 2024 20:55:09 +0800 Message-ID: Date: Mon, 3 Jun 2024 20:55:09 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH-next v4] arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION Content-Language: en-US To: Russell King , Ard Biesheuvel , Arnd Bergmann , Fangrui Song , Linus Walleij , , , , , , , , , , , , CC: References: <20240316023932.700685-1-liuyuntao12@huawei.com> From: "liuyuntao (F)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemd100004.china.huawei.com (7.185.36.20) Gentle ping On 2024/3/20 1:12, Ard Biesheuvel wrote: > On Sat, 16 Mar 2024 at 03:44, Yuntao Liu wrote: >> >> The current arm32 architecture does not yet support the >> HAVE_LD_DEAD_CODE_DATA_ELIMINATION feature. arm32 is widely used in >> embedded scenarios, and enabling this feature would be beneficial for >> reducing the size of the kernel image. >> >> In order to make this work, we keep the necessary tables by annotating >> them with KEEP, also it requires further changes to linker script to KEEP >> some tables and wildcard compiler generated sections into the right place. >> When using ld.lld for linking, KEEP is not recognized within the OVERLAY >> command, and Ard proposed a concise method to solve this problem. >> >> It boots normally with defconfig, vexpress_defconfig and tinyconfig. >> >> The size comparison of zImage is as follows: >> defconfig vexpress_defconfig tinyconfig >> 5137712 5138024 424192 no dce >> 5032560 4997824 298384 dce >> 2.0% 2.7% 29.7% shrink >> >> When using smaller config file, there is a significant reduction in the >> size of the zImage. >> >> We also tested this patch on a commercially available single-board >> computer, and the comparison is as follows: >> a15eb_config >> 2161384 no dce >> 2092240 dce >> 3.2% shrink >> >> The zImage size has been reduced by approximately 3.2%, which is 70KB on >> 2.1M. >> >> Signed-off-by: Yuntao Liu >> Tested-by: Arnd Bergmann >> Reviewed-by: Arnd Bergmann > > Reviewed-by: Ard Biesheuvel