[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210108211903.GF2547542@ubuntu-m3-large-x86>
Date: Fri, 8 Jan 2021 14:19:03 -0700
From: Nathan Chancellor <natechancellor@...il.com>
To: Alexander Lobakin <alobakin@...me>
Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Arnd Bergmann <arnd@...db.de>,
Kees Cook <keescook@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Fangrui Song <maskray@...gle.com>,
Huacai Chen <chenhuacai@...nel.org>,
Pei Huang <huangpei@...ngson.cn>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Ingo Molnar <mingo@...nel.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Corey Minyard <cminyard@...sta.com>,
linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, stable@...r.kernel.org,
clang-built-linux@...glegroups.com
Subject: Re: [PATCH v4 mips-next 6/7] vmlinux.lds.h: catch compound literals
into data and BSS
On Thu, Jan 07, 2021 at 01:20:55PM +0000, Alexander Lobakin wrote:
> 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@google.com
>
> Suggested-by: Kees Cook <keescook@...omium.org>
> Signed-off-by: Alexander Lobakin <alobakin@...me>
Reviewed-by: Nathan Chancellor <natechancellor@...il.com>
> ---
> 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/vmlinux.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..compoundliteral*
> #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
> --
> 2.30.0
>
>
Powered by blists - more mailing lists