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/[email protected] > > Suggested-by: Kees Cook <[email protected]> > Signed-off-by: Alexander Lobakin <[email protected]>
Suggested-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> -- Kees Cook

