Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp295060pxu; Thu, 7 Jan 2021 05:23:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxu8wbz0LNY6Z1MbDruNXm8hzkmF8SuX98m+ahfAjWK7YGWAyO3wY2f9kYDbm0wynS+MdQF X-Received: by 2002:a17:906:447:: with SMTP id e7mr6275705eja.172.1610025819068; Thu, 07 Jan 2021 05:23:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610025819; cv=none; d=google.com; s=arc-20160816; b=gPsytOUtVqei9RlhtdGQ8vxk0Geqce8/c138i4jz/l4vZ796IXQ2vhEs4CF2ttXgQO Luciabzl1nW7AXhlQN8fuPC3ovYXnvVQPxmkGznJ5nXf6130HZSYIy0eHKcIVaW49+KR UwjOUu/J2GCdGlCBAQ1VCfJArk38DYdn1j73w+/dqEvQ2DlQk3eyZPaW9naRYHSjp7TD Tq56PPWCCb2COraoz+Lb5D2A7LdMGqmfM/eg4+iG5tCZN70IoM4XRbpfqzlANPEPgHGE zWQ/7jv6Po28Dz9GwCU9Wi0NCdBEXXnBZ9E0FKl4F6ELVxAjS2dPBaYaVg62m9omQ/hU dzlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=tAhGyp2geX19Adc0pmsweHYMg6GqMIq+Zk7djwr/y7M=; b=sv2ggmgyNXQBKEdnYJk0JDXAGWXB+/G0yDaPJu6zZJwt1e6084whTrneqchu4fzBYl aAqD7PcqwCoHSqlyh5bB0kTsIdigc9AjS9vTk7t+624IgR6GQKqH2VNvFzHtORmB+k0o Zobk/17GDESoB/67mTdjun5FkCXV9ks9ayHQ+s7WTwePj7qf04aq+Rrbhq72flFNa53W Y0krII913o4RG08n44EFGEP/MUr/TcouuYMHYcEJSmyb/a/BehKMf6lP4IJrfuY2mrjW LL9X7wFTlIILcB1Q0Va/wMytHtxelT4ouRw23wcj0VVBtpijxLqEdtPIpT/9BiimxePj lfIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=fMAChsxh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp1si2165199ejc.21.2021.01.07.05.23.15; Thu, 07 Jan 2021 05:23:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=fMAChsxh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728494AbhAGNVs (ORCPT + 99 others); Thu, 7 Jan 2021 08:21:48 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:45699 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728100AbhAGNVr (ORCPT ); Thu, 7 Jan 2021 08:21:47 -0500 Date: Thu, 07 Jan 2021 13:20:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610025664; bh=tAhGyp2geX19Adc0pmsweHYMg6GqMIq+Zk7djwr/y7M=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=fMAChsxhN37qCfBmEwpgDN7pHIELWE4oEMllD4cxn+PyA8L+hPw26OwD3+JVccWui 06aq+eRq8a4InUotyP1RyI0X20Y6x90l5cn3bCTogmA5RDs9ZRyJdfaPxfk1LoPDkG 4YlRElx0ohdWxN2Aw8xwxLRmlS2gLO2df0Mb+VfVYurfgdocVZpjzFRjCfH3jP/EUr X3x1gBCSI/k767qtRhMWqgWuhl/it4x0GswYdykTHF457MqkBtrr0wVXAUCUn8x1oe WX9CaY4VsDc6h3fnJ6Mglf5ZWRqX9GktvLw3A1N27oJdSfauGXUtacdsSp3qDgbI0t ZwudvWYogKkCw== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Kees Cook , Nathan Chancellor , Nick Desaulniers , Fangrui Song , Huacai Chen , Pei Huang , Jiaxun Yang , Alexander Lobakin , Sami Tolvanen , Ingo Molnar , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH v4 mips-next 6/7] vmlinux.lds.h: catch compound literals into data and BSS Message-ID: <20210107132010.463129-3-alobakin@pm.me> In-Reply-To: <20210107132010.463129-1-alobakin@pm.me> References: <20210107123331.354075-1-alobakin@pm.me> <20210107132010.463129-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building kernel with LD_DEAD_CODE_DATA_ELIMINATION, LLVM stack generates separate sections for compound literals, just like in case with enabled LTO [0]: ld.lld: warning: drivers/built-in.a(mtd/nand/spi/gigadevice.o): (.data..compoundliteral.14) is being placed in '.data..compoundliteral.14' ld.lld: warning: drivers/built-in.a(mtd/nand/spi/gigadevice.o): (.data..compoundliteral.15) is being placed in '.data..compoundliteral.15' ld.lld: warning: drivers/built-in.a(mtd/nand/spi/gigadevice.o): (.data..compoundliteral.16) is being placed in '.data..compoundliteral.16' ld.lld: warning: drivers/built-in.a(mtd/nand/spi/gigadevice.o): (.data..compoundliteral.17) is being placed in '.data..compoundliteral.17' [...] Handle this by adding the related sections to generic definitions as suggested by Sami [0]. [0] https://lore.kernel.org/lkml/20201211184633.3213045-3-samitolvanen@goog= le.com Suggested-by: Kees Cook Signed-off-by: Alexander Lobakin --- include/asm-generic/vmlinux.lds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index b2b3d81b1535..5f2f5b1db84f 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -95,10 +95,10 @@ */ #ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION #define TEXT_MAIN .text .text.[0-9a-zA-Z_]* -#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..LPBX* +#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliter= al* #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]* -#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* -#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* +#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L* +#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral* #define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]* #else #define TEXT_MAIN .text --=20 2.30.0