Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp730115lqb; Fri, 15 Mar 2024 05:10:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvfVa4ksqVwGUdY0D3rjhSYjjkzyFBGeJ0/Yyr5NmuZbvWHY/QYgp8b5aEWuFlaz+jIuF2t9HLkLlf7ZRjWJo1c7Cq2QEp4oyWILeMsQ== X-Google-Smtp-Source: AGHT+IGu2ickZvfEbly63yIrL0hvGOcrdoPUmCpItS9qV+k43nuHdqJg9u60xrVTj+KfgZkCF/qN X-Received: by 2002:a05:651c:2109:b0:2d4:8aa4:e1d4 with SMTP id a9-20020a05651c210900b002d48aa4e1d4mr1344727ljq.50.1710504619557; Fri, 15 Mar 2024 05:10:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710504619; cv=pass; d=google.com; s=arc-20160816; b=PJ4ycfHGF0PxEq4I4VU88Q6hJX4L1djwMh23LyRZUAmA33ZULmEWsLBDEIVtFmVPdf m3BC70OAcSl/VdzVNMWjClOUulu2HajlQQ1cxty9fZhUlHJbBEGIwvFN4YnsBA4ZsMya xooIQN5xToNDQyEGCZFHtpzRrgCk6i39Un8QdYYVv1sJ1yXdhsGrurToW+S0ravGIn31 93jHQJQCZzKpnwHaFepT6wFhfwqNsy2dk+sNE3hcn3wXzt27IE13YFk0eeI+6YLn8DAy HQ+iwtSctD26ftHHkLVTeRD9/UIZVm6BSFt9ZPJ+pzZFPw0WR3fAXvApMd0rXN2nMm8v wDUw== 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=Ef5Hd5ie3xABIEvT9yD9ap5Y76OfHMQZdtLUvwD6z2Q=; fh=JYejx3Yb1t/pgtfwnYPE28kSslVc50NvPayuiqdBd3Y=; b=nabNf7cOc72D7eQRPaXTSHeEKrT56+9eQnxHZfwcPPlbm5sV2tWh6oae9zXKm8lLIH EyIGh/G9f3wv8t8xubQLf+Fzq0jm7LbJcpBfuu7wrVPULQqrWjpSDeCCVV72PivLAHaQ oUzVbMat75OTT3582rGn+G0jNOWnrqdgrErzLCMZAJ2nIH/rMOYVSP3sI6I6aMug3OKG YA8TcFjD3dX3SgxVhX/USP9TyJ7XTTJ8RTnqWPQfMHlq3lO7KNbiJho7gdqeb6R0QTLJ OktmQHFgUe7Xu07MspNT90azpw0c+IebPOL6B+vO4mx1QFfpqemVUAtwVIVNI25btYi1 VqcA==; 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-104380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104380-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. [147.75.80.249]) by mx.google.com with ESMTPS id a13-20020a170906468d00b00a469af5c17csi23745ejr.904.2024.03.15.05.10.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 05:10:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-104380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104380-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 48CCB1F22510 for ; Fri, 15 Mar 2024 12:10:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AAAF1C291; Fri, 15 Mar 2024 12:10:13 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 31D6F1AAD0 for ; Fri, 15 Mar 2024 12:10:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710504612; cv=none; b=nNWK62IMD2CoA14ScBCntbnWK8HUukIqRlixoM95kyPN8Fqnv8hO1BYQmY/+ssAcbDm2I++cgIkEchHVhsBowqKUdLXi5NsiPxfpjWUe1nn0MjBEc4qyPVTE2zD2pUP8QcxyxoxFLO6gVLWOG54AVKDK+/XoITJIt1MMRZ9Omxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710504612; c=relaxed/simple; bh=q/8fKxBpy2WLKGEdc5597DHiRCg+9LU28fhtHRHJkRs=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=QaNn8yg0N8wvBek3LGokbwIy8FP87GwmQ/IJCHsSb2efZAdi6WtwbXZDxQBxYzrVR8wfCj5O7+kg3BGSoQD3rbN2H3GyK84p7w5+OetpxeHGeL4/Os2k/31e6/ECeQvIRON6lgvJ2UGPf6ys0Xyi0JLKfVkeiPgHWbDEzU9IuDI= 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.191 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.163.44]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Tx30S6j0zz1h2Q9; Fri, 15 Mar 2024 20:07:36 +0800 (CST) Received: from dggpemd100004.china.huawei.com (unknown [7.185.36.20]) by mail.maildlp.com (Postfix) with ESMTPS id CDD7B140124; Fri, 15 Mar 2024 20:10:05 +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.28; Fri, 15 Mar 2024 20:10:05 +0800 Message-ID: Date: Fri, 15 Mar 2024 20:10:05 +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 v3] arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION Content-Language: en-US To: Arnd Bergmann , Ard Biesheuvel CC: , , Geert Uytterhoeven , Russell King , Andrew Davis , Andrew Morton , "Kirill A. Shutemov" , Geert Uytterhoeven , Jonathan Corbet , Mike Rapoport , Rob Herring , Thomas Gleixner , Linus Walleij , Fangrui Song References: <20240315063154.696633-1-liuyuntao12@huawei.com> From: "liuyuntao (F)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemd100004.china.huawei.com (7.185.36.20) On 2024/3/15 19:51, Arnd Bergmann wrote: > On Fri, Mar 15, 2024, at 12:48, liuyuntao (F) wrote: >> On 2024/3/15 18:46, Ard Biesheuvel wrote: >>> @@ -28,6 +28,7 @@ >>> -DEFI_HAVE_MEMCHR -DEFI_HAVE_STRRCHR \ >>> -DEFI_HAVE_STRCMP -fno-builtin -fpic \ >>> $(call cc-option,-mno-single-pic-base) >>> +cflags-$(CONFIG_ARM) := $(filter-out -fdata-sections, $(CFLAGS-y)) >>> cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax >>> cflags-$(CONFIG_LOONGARCH) += -fpie >> >> Another error: >> cannot initialize array of ‘short unsigned int’ from a string literal >> with type array of ‘unsigned int’ >> 17 | static const efi_char16_t shim_MokSBState_name[] = L"MokSBStateRT"; > > The line sets cflags-y to an empty string. > > It probably should have been > > cflags-$(CONFIG_ARM) := $(filter-out -fdata-sections, $(cflags-y)) > > (small cflags instead of CFLAGS). > > Arnd Oh, my mistake, after fixed this bug, still this error: > arm-linux-gnueabi-ld: warning: orphan section `.data.efi_loglevel' from `drivers/firmware/efi/libstub/printk.stub.o' being placed in section `.data.efi_loglevel' > arm-linux-gnueabi-ld: warning: orphan section `.data.screen_info_guid' from `drivers/firmware/efi/libstub/screen_info.stub.o' being placed in section `.data.screen_info_guid' > arm-linux-gnueabi-ld: warning: orphan section `.data.cpu_state_guid' from `drivers/firmware/efi/libstub/arm32-stub.stub.o' being placed in section `.data.cpu_state_guid' > arm-linux-gnueabi-ld: warning: orphan section `.data.efi_nokaslr' from `drivers/firmware/efi/libstub/efi-stub-helper.stub.o' being placed in section `.data.efi_nokaslr' The -fdata-sections option is present in the KBUILD_CFLAGS_KERNEL variable; altering cflags-y only affect the KBUILD_CFLAGS variable. It seems that the -fdata-sections option needs to be removed from the KBUILD_CFLAGS_KERNEL variable. > ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION > KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections > KBUILD_RUSTFLAGS_KERNEL += -Zfunction-sections=y > LDFLAGS_vmlinux += --gc-sections > endif