Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp737235lqb; Fri, 15 Mar 2024 05:22:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJ2CnI60AwfizOFdw1adAC+svq/thWdz6p86ETOLmd+foVPhgyfRUkw2FQDb4g23ZR5bdx5Wxt+OzvXiKP/nA967nMdQWCQLl/y6fdvA== X-Google-Smtp-Source: AGHT+IHx1VmeuVIw9ZxfO2UAC1SvN9NQTU8O5ER2oW27Ck0ZuMGElllFGFsPdsw8c7mq/TwUA+zK X-Received: by 2002:a05:6a00:1897:b0:6e6:c38e:e8a6 with SMTP id x23-20020a056a00189700b006e6c38ee8a6mr3761011pfh.4.1710505332035; Fri, 15 Mar 2024 05:22:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710505332; cv=pass; d=google.com; s=arc-20160816; b=Wv7qwvNJBsvcTd1PBEksd9hXulqUhQHxf7V4DXmxwAZMl9q5j6DLB5DU/xRWK/lDMF TNbzSE5czq06cA2Q2LxwSIlo9gtWp2Np23T7g0kjPp9NtJijs+nhtzRLzzk82W4JLzWP Z+SXmH44pLNXDsW9EM+6SbJsPF6i7zN6JeHNtCD7baG5++8rIL24/PNeOX61dAuX/Uvu PoJyYmzRmf8vDzLBza97NEfiT1BamZyzM9LMNnGJQNYUm9jgpmWfRWw7S3+tUbyiWDLW JyJqQKz4GrwMglXEXhLosJzamEW+gFumJyx1tu+2fE9hy60HSytlVgVhy8bHYG8nIzmS in/Q== 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=V5JNkyuiv1Wf/v5jwUObP6ELR7sPzSyyHI/YZbssiy0=; fh=tuhea4ill+61fE2GUtJBxSJxfWWC6IUGMa+pQff/HKI=; b=zsije+EBaslW2b9pjEryEVbr/epojsW933KqSXstOdJtM0qazD/k4/9Xx780KML8rt dnNTmhRyp7zSzvlF9WscADNN+TWQeyiPgvlN/EqbLD2eN+ZypRs7DoyE2qOQimhO8UrF HRa3wEfhifneQ8XpMrC7+tDn/zdLszb+/vHn00F6eup3IJDMzm3S2fGu830cBr5MN2bn jA9/m+s8pKQe6B8knwwQeP6tsgxHqfazp5jC7268fjAS9zD0U0Awsz4Wyg21DkEERx/q ZwNtwhtsQbLWkcD1qYpLq52w+xg4wfsP8JAydlQlvRQE1wCrdSX9Bn1upa2xfxZyX/oW PpFQ==; 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-104391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z10-20020aa79e4a000000b006e67b7375d1si3432206pfq.148.2024.03.15.05.22.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 05:22:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-104391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104391-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B4BB928366F for ; Fri, 15 Mar 2024 12:22:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CED941C2A6; Fri, 15 Mar 2024 12:22:06 +0000 (UTC) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (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 13F491BC2C for ; Fri, 15 Mar 2024 12:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710505326; cv=none; b=JQ9Z3PLRJsiw24oLeMTNdQnJMbeiWE12UbYS71QcMuaEBfUsYPszx+0z0qBhiexozWEWbiYssvyMdKtzcgIFFuD0DtJaa242YerT+0t80BfeYvcbAxTHlLj1IGB/KdpVKGdLN0ZLkB1eKLkNBN3cJf/Nj9PcmLDdXrJHZjJCr5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710505326; c=relaxed/simple; bh=bI0PhVqBa5hSvI5R28R4JKjzn0Em27kPqJgc0vQSNmU=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=U0cUcn0t+wz5jk5PvDPZ7Ru63qhKo+QBX5ex7GCkHnzXbHneeZ1hHvmdBVFt/DMDuaj8vBkz4v915bo3JpET5zSq6O1m86TpVzwxxmBw+7+FvGSFkKhNkn1c8J26goLeKCuzc7pXp2wMA4N4pxyCPTvP8GhsqcHtNuyNMGj7MqA= 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.35 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 szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Tx3G63jnDz1QBbP; Fri, 15 Mar 2024 20:19:26 +0800 (CST) Received: from dggpemd100004.china.huawei.com (unknown [7.185.36.20]) by mail.maildlp.com (Postfix) with ESMTPS id E8F82140124; Fri, 15 Mar 2024 20:21:55 +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:21:55 +0800 Message-ID: <31f3a3fe-b16f-47a9-8c41-80fc0a236d52@huawei.com> Date: Fri, 15 Mar 2024 20:21:55 +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: Ard Biesheuvel CC: Arnd Bergmann , , , 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: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemd100004.china.huawei.com (7.185.36.20) On 2024/3/15 20:13, Ard Biesheuvel wrote: > On Fri, 15 Mar 2024 at 13:10, liuyuntao (F) wrote: >> >> >> >> 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). >>> > > Oops indeed. > >> 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. > > Indeed. > > So > > KBUILD_CFLAGS_KERNEL := $(filter-out -fdata-sections,$(KBUILD_CFLAGS_KERNEL)) > > (assuming I got it right this time without build testing) Um, it not worked,too, same error. > --- a/drivers/firmware/efi/libstub/Makefile > +++ b/drivers/firmware/efi/libstub/Makefile > @@ -28,6 +28,7 @@ cflags-$(CONFIG_ARM) += -DEFI_HAVE_STRLEN -DEFI_HAVE_STRNLEN \ > -DEFI_HAVE_MEMCHR -DEFI_HAVE_STRRCHR \ > -DEFI_HAVE_STRCMP -fno-builtin -fpic \ > $(call cc-option,-mno-single-pic-base) > +KBUILD_CFLAGS_KERNE := $(filter-out -fdata-sections, $(KBUILD_CFLAGS_KERNE)) > cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax > cflags-$(CONFIG_LOONGARCH) += -fpie