Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp244126pxu; Thu, 7 Jan 2021 03:56:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/OQCYtgdQDfV3uEaqD9x9MUvnSxee0JfRJ3juNLssZHJSBa5/MI5N57v2AfID9rIJR9iU X-Received: by 2002:a50:a684:: with SMTP id e4mr1402625edc.148.1610020614695; Thu, 07 Jan 2021 03:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610020614; cv=none; d=google.com; s=arc-20160816; b=bPCbidEaZrJcnBkh59fiuHkoTY1Vy2eQw2g9KrWsM9uw5Az1Gz/Je5NU7KBKU3h1d2 8pjlWbD2W27gT+h2Jd5QmrBbzLDRpZSWnkHTRKaFD0UIO5VmKLa6CXJyabEwWhHnRUGa x8Suv3FR8nuofppLO+eDSAfOHzrJ9HdS6I5JOsDWsZ3QKlXK+nbmqFEI2ET/UEdr7LGI dinGLQYcxG6LTbZrlQOqXsWUOZ08Un9erJzNE3Z4ba/Dd4zRevTWwpLZWCKxtoSKXe5N 5N6KHlk0tVqxD8d79pYx9X/We/xymHdv47rA7lYKz4ba+34N9uv4G1g9V1EdJe6nagZ2 45gQ== 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=mumws6AbM4Tog2iv5qTedIEvoVVoFf0cAfaK8ulIfxU9QzyqWJWZBEMv4yF8ov8Ipk IBihZ+8vPzgQdhfZ15G2MWlMHzcwJ5g6ENsVYUM4RsuGVKCpew0VCAQnQWlHKZJZIhq8 xrYR+0/pa5yPAzIh2CX86EWicEibjpbLgve91HsRdJKQagoZ/1pq3AEnuUciTGB9DSXN CpSX887aKq4qDu/R+bg+ujf5wSMI15h0l1UQI5zxkYAxpiWJtMswIrcC1uYf+ON3xB5H ws6D+A5IlFjuzWnDwPgWLVuZZ1EkGPId5LrdlLde2maCX2hmxq3R3FcjZ7FmOGIWp01n XYVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b="amg/7JOJ"; 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 v5si2153907eda.107.2021.01.07.03.56.31; Thu, 07 Jan 2021 03:56:54 -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="amg/7JOJ"; 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 S1728105AbhAGLzM (ORCPT + 99 others); Thu, 7 Jan 2021 06:55:12 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:34421 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727949AbhAGLzJ (ORCPT ); Thu, 7 Jan 2021 06:55:09 -0500 Date: Thu, 07 Jan 2021 11:54:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610020462; bh=tAhGyp2geX19Adc0pmsweHYMg6GqMIq+Zk7djwr/y7M=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=amg/7JOJnqFWWVQp/gxCX6tnUeBa8j16Rk1uTsVynSGorkosoyeIqnL7nLDtgPxp2 T1Q9+3BAYT41ifEM/+EtsI4ntgGbrbFZH7vigGO+RpZ99dnjPrSshSJzDBWBOfs5La /ZoLyuHNVd9hJ+mUXXQsIhoOooqoIerVtfG6AMoRs29Aa5AxieIiBFaSRdhcAfJCjJ ENKwogm6sCOq//rikZZipdJlQ/8cTW6/yXGuJRdOiM3VleUB1r8W0e7UmgFWOxgWXw zJOFS8HZze4RvM29KSSxqYIraXrZvN/AMTFDF1+hm0hF7ZuFMxc0YGrYWJ5e0UDsA3 4FH+hCykb4pzg== 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 v3 mips-next 6/7] vmlinux.lds.h: catch compound literals into data and BSS Message-ID: <20210107115329.281266-6-alobakin@pm.me> In-Reply-To: <20210107115329.281266-1-alobakin@pm.me> References: <20210107115120.281008-1-alobakin@pm.me> <20210107115329.281266-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