Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1594840pxb; Sun, 10 Jan 2021 04:00:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxg8KeOwqQD3Q/R4JeMUaIeZQX0zqLmlmImRJ8v7vBqRST60UX5RNZxHr5E0sVocT9w5NJD X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr8404166ejb.352.1610280044228; Sun, 10 Jan 2021 04:00:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610280044; cv=none; d=google.com; s=arc-20160816; b=CHq9R6Y8hVg/0FBACCx2qL3b+mKOe3HHUJuOQU88kqo7vGBbPQerZ3imuYaritv6Sy 7KdwgeDlj/6E8HkyYUVyMv17rq47zhu6GR/lpY5UQTnNxN5jQuniNAwJkG5QMvZMu+rY Tef5zFBbIwSCdl/OgrMPcFvz6gqDpg9/oHoBA0klnl+w68OblxbRUhoK0yGbzGJV72Za z/tv5t3Ss+4vaPFNvixwYijWldztdORtLEp2hzDTlxfJHKrKPGuN+ENwAYWWsO9JvCoh xZcugZqk09x/rSG02aDhwBt1BZU8RKYsQIqnaNI/GhWqEPyzr3rE88WtST+Lu87kZMsQ SQlQ== 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=x8cRNNoQDUio05HqY97IXykwYEnNtBTKUh4spQvRTkU=; b=VcjfeicVQKUY0i9Cyh5hO77ngllziltEl1Kc2mmDOujbbh/UDkqzr7/MS+7ZvGXobr 78sxO4KuecVSYgWJUYmhKgeLegrxVNA//kx5TyzFk1uw1PZXeNChKjlMSgt2uOWqU7BL 3ozbPJveqSlb8T0RNnswj8VxlTAJPPJ0BhFw2H0zPL/HCj3a0UcBWffTLR1XcElLCu63 3fcKEUt6AB5KKruQTSH+QKOKACWVPBEobjCWWayrjkdZnW5JCJ+8KxKZHQvVnDU0mbt4 rRaxWN6j/Qmra56E+RPf5tuUFvIcEULzmGBAuR479C7mG7RxeQYQXsv730VG9qjqa0il mM9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b="Vn6/a5xZ"; 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 n6si5372353ejc.567.2021.01.10.04.00.19; Sun, 10 Jan 2021 04:00:44 -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="Vn6/a5xZ"; 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 S1726841AbhAJL5w (ORCPT + 99 others); Sun, 10 Jan 2021 06:57:52 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:17066 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbhAJL5w (ORCPT ); Sun, 10 Jan 2021 06:57:52 -0500 Date: Sun, 10 Jan 2021 11:56:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279810; bh=x8cRNNoQDUio05HqY97IXykwYEnNtBTKUh4spQvRTkU=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Vn6/a5xZo9524H3sJXKD1skGlwNWJBKpxsaQlelflZWpiRO6mvcpRXbkqWhE1penm ndkAzPHQ6OJZnJMzz1W6177XAau2X1iZiwugVn1rACTV1Typ9lpvgpFAZQ9moC2R5d SoyJ4LnYL/PbTdyrTiw92NsZf8ayY1ZA44dtUgQN9XX6hp+EbnFKmC9kgotXWQ3U3P nxwov3RXk0ZzC8oYRrLAsmhVLmFA+7dPmPQeJCIvf4+jcbtukzYFduFdFK5CX7B6M0 xPyUxcRog1HRkHy3MIgZgnMDgH79NpMZVKdPNMBecY7x9TT6tCZeKTYerByMaaXvu4 7D83kWhj3y2eg== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , 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, Sami Tolvanen Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 7/9] vmlinux.lds.h: catch compound literals into data and BSS Message-ID: <20210110115546.30970-7-alobakin@pm.me> In-Reply-To: <20210110115546.30970-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> <20210110115546.30970-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: Sami Tolvanen Suggested-by: Kees Cook Signed-off-by: Alexander Lobakin Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- 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