Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp626362pxu; Thu, 7 Jan 2021 13:53:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxn9/tbZIryzBRAfaf61gYlrDezknf58WNEYQUgl/GhDSWww5IR/ltR+zFaVHlqWBgKHNbt X-Received: by 2002:a50:9ea4:: with SMTP id a33mr3097815edf.70.1610056388944; Thu, 07 Jan 2021 13:53:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610056388; cv=none; d=google.com; s=arc-20160816; b=c6mC3LRFQC7OZuxWFOih2SNY1QSrksYOYLrUAWPcwRT7r80a7rsnS5xcbcGfLvN3XM K3pBn+W7ONBUpyvz8Y4CoB6Rr/vyj6SvcnWBCChd/ITv4iFlrQphdUAg0pFzVAMedLwd 3KB7JwIHCMeDDnO1f7W+y570IRx2C50YBagtKfXJ8SydPQ2070hZcBGdgXpqex1yueRv hUvmkZgGUxbGyktufHr0NW2iGmnpgFHRgSVVxtOPveaLkHdXIA/MeyBJ+07KTPMDv1jS YEcC35Y4bysvTZqu/NxolhX/CjggFhy4zSHWpg4mjhqEo1QFhtrZ5qChudh/lpv7WRW8 TD7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yYl0v+xaEIAu5r6/bYBSilTtfXXwd7aNC1GvRalHHZo=; b=O68jHD4uv+s+pS8O3Tk6DQaB2A4QnG+Tw3oJ3aT/FmHNqf9UZOOyGVW21aQyzNCoIe XnhFgvvXJYw5RmwzYmebE2bVWNUBTbRkY5g4OFEBMgZnFSgLJN0FGA6ccNNi0S96EKPs lWglT5mI2WXEYPKGb1xVQjDfgpMa5Jk8hk1fYFemyJeYXZHYERt1YK4vYbHhmw0ADqI+ EK3kB7PqOZkYozJxPLRDdH/JaIT8/Qrlg8njy27JjpbsydBQxF3QkPFurazv/ByFfanI tVOE5O49cLez0Xsv3DWf+mtjoV3gHNBFz7rkm+bi8/uFUbaDwvClvEwxLeF1bwAoHqq0 ntCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Ve/7Nd5I"; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si2690304ejo.619.2021.01.07.13.52.45; Thu, 07 Jan 2021 13:53:08 -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=@chromium.org header.s=google header.b="Ve/7Nd5I"; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727790AbhAGVvq (ORCPT + 99 others); Thu, 7 Jan 2021 16:51:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbhAGVvp (ORCPT ); Thu, 7 Jan 2021 16:51:45 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB3CC0612F5 for ; Thu, 7 Jan 2021 13:51:05 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id v3so4485556plz.13 for ; Thu, 07 Jan 2021 13:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yYl0v+xaEIAu5r6/bYBSilTtfXXwd7aNC1GvRalHHZo=; b=Ve/7Nd5INnaEy8CbPNdKMJtPRPO9+pgspz1Y9n4YGnNTDagRFwC9JAeZesbIgkY0CY K7lTK6VzA9sgb2tzfHvxcjddJuJb5Pf5JprdA3W1L/QOW+tZhGsXRrqxHYl04UdthbX1 sh6t+OvYBaxi65UWj5ZWyvLCHLY0m4LAc8ypI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yYl0v+xaEIAu5r6/bYBSilTtfXXwd7aNC1GvRalHHZo=; b=g+1ScQFAyJdMuOICKAvokkujEcsd8oy1PX+huoM9nA0HFpDv8vs/gpm2t7HjensN9x F3NT1iH/EPSgKQ/r6OajjK3D2KSWd7LBCLcmBud7GuSg7dojIk0Qz9dcnGWHoK19eP6Y RYv4rwHw1+kQtNlZr2kyTYEGLYdNNG5ai0zO72sGIbdABxe97oSiLqE95xPKSSE9rKhl C1fnPEYlDjvAimEDyUJ/D6K5ykU1r3u8r+iGtmG5pSYAij3P5ETHRdKEY6ULfiJJ8vE+ uVN+wxlHrVZKPmQoFc4RUI2uzj1eE4ao9RPkGOnVVbxVuHvmd5eUmwZ2uHzZE3j4lwUH +I4Q== X-Gm-Message-State: AOAM530pc3H8VtL9o9ArSHkXsUruT/n9r+8nFSWCAUTkgh0kVzbHDT/e 5ZscDuXOTH8DLw7GbGD3bVSLQQ== X-Received: by 2002:a17:902:be11:b029:da:ba30:5791 with SMTP id r17-20020a170902be11b02900daba305791mr788751pls.13.1610056265144; Thu, 07 Jan 2021 13:51:05 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id v1sm7737287pga.63.2021.01.07.13.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 13:51:04 -0800 (PST) Date: Thu, 7 Jan 2021 13:51:03 -0800 From: Kees Cook To: Alexander Lobakin Cc: Thomas Bogendoerfer , Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Fangrui Song , Huacai Chen , Pei Huang , Jiaxun Yang , 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 Subject: Re: [PATCH v4 mips-next 6/7] vmlinux.lds.h: catch compound literals into data and BSS Message-ID: <202101071350.B643907EE@keescook> References: <20210107123331.354075-1-alobakin@pm.me> <20210107132010.463129-1-alobakin@pm.me> <20210107132010.463129-3-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210107132010.463129-3-alobakin@pm.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Alexander Lobakin Suggested-by: Sami Tolvanen Reviewed-by: Kees Cook -- Kees Cook