Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1350413pxf; Fri, 2 Apr 2021 08:10:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfi6AYw/iqZewjl/Okq/XYT0abAEDHLRYBLHHwL8T739C2u11590EHAj/AFbNPKX+NA50R X-Received: by 2002:a17:906:13ce:: with SMTP id g14mr14624364ejc.378.1617376220913; Fri, 02 Apr 2021 08:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617376220; cv=none; d=google.com; s=arc-20160816; b=mgFj7Cg5Jw86dPLME9kALYNZgKbMc7WEmUvlAC20iah3sQptWdjuFoYYyArWr8rUqk jTcOrbmE0ahC0TyvJJL8p7OUU/yjtvcCXY0uONp5flR8Y4FcXCdnKWDcVxxOUPZHJnTi 2py+vlr6Wj9FqSgA9sxeWDKrBuYyEE6FJEXyPLU+JhYxpAEWtZiFvPDtgcpgSf5K2OcY un5SJ0H31HVWVpYNshEYfQac9iGC2JOAQyu1EYs4pTUEjQHevNgvady1a8mU3CujehXB Pk7KZ9q2w7G03Gqc3yif0ycuXqLMSW34kyw8HgO1mgwX229NFx7a/VJw15Uv3caL1AOw AuqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YgtLUE8tLw2Zk1N7ATFrtV7j3dv262lk75CYdDYHcbQ=; b=EWOO1XLwZuE7lYgcBxGiQJp9aW9UP9Zax7X+xa76a1KtFHd+jkxNFJ5222sYAYAPrd ENnwaueGVgOGYlFwSxulrPrEzCWgssloRpVue1PxUvyqA87cGUiPimBqWix8Z2Kiliqz lnRHQQqaWNWddgm5UhzkU9gPGNLBKgla++hdd51cTrR8QEVW2A1AWFq4vMpttIrMk0lc SZsNcaMWYwahMqPZgBim3ACjqHoLJBWWgbF+yW6LFU1nC6m+I9I7imGM8AfI1bryLAwW TRk/R88lZvPj+kDjAZHwdFLO0Vkhn7nXJv5x96hnGY6dH7njPcskI6ZP3X31ruxtc1aH YVDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=kd9SvTxY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ov28si1143281ejb.96.2021.04.02.08.09.57; Fri, 02 Apr 2021 08:10:20 -0700 (PDT) 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=@google.com header.s=20161025 header.b=kd9SvTxY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234673AbhDBPJP (ORCPT + 99 others); Fri, 2 Apr 2021 11:09:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235327AbhDBPJO (ORCPT ); Fri, 2 Apr 2021 11:09:14 -0400 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1388C06178A for ; Fri, 2 Apr 2021 08:09:12 -0700 (PDT) Received: by mail-vs1-xe30.google.com with SMTP id l8so2879738vsj.13 for ; Fri, 02 Apr 2021 08:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YgtLUE8tLw2Zk1N7ATFrtV7j3dv262lk75CYdDYHcbQ=; b=kd9SvTxYOWxn37TZiIkBotQfbjom6BmDGK0QVftHGDvVKbWOFqt4n8MYddo3K4uEPz GN/98Lwen7yHTB62wzUNAQz1jXtxtm1hMrk8ea95f9lVhuj6DLC0U+0fpRnyjZi/OVRe Dc7pnlam/2yWvqj/HepMcxqxki9N5cJoV/mXsLrGUlG0j2rwfDuJ9p6uuGK5erg4WmS7 1GU5d7RE3sOtUkXxb6wpu9srfEvaZovXTqu3jIu1G3Jo26tk6ubAobk1V4hwM+GsJSm1 Z/eMDJLpSTQW8Ihc+u/t9FXiP583UEEdRdmZD6kem8ORj6oIdrLSzqWc+RGmPhl7i6Fx psPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YgtLUE8tLw2Zk1N7ATFrtV7j3dv262lk75CYdDYHcbQ=; b=N9qGeEsO1r1DF2UtZKcXPibPZOisFJBpLRXAp5E2RuVSnzZdQzDOCT8fXBgDKMujSk q37dHJHed4EqwIC646ZbFQQ2X+ZZJozUPdhL/TOPm7OqSEfDtzmwOQiVotIi46Q5pNof lUDRIrVA+lnsPgSI8JlYCosJUqPYGkgaVGHsB0FvcvITefHfkusUrF8pC0l9jI3R9GCS RWnQP0IuFN26zcAJmU3JNbcpYBIcf0vSvPptjao1RA23iaELpGeyZ9yQCsEWc0PpNw/Y lsaxCc2oQ2TXngfcLPrLq8g4W1ON3RftWOTcssPQ01/x+gYUBQoy8Ka/luG+8xcl/gB+ cylA== X-Gm-Message-State: AOAM533JuJosgUPfmjcu1gzPeFLJx0JdB/S0zTgXiFljJ+DAzocozn5/ GHQo4q5hUhFJJpNK5qKVXb7sDWsZnMZ2WtDdpYFwaw== X-Received: by 2002:a67:3043:: with SMTP id w64mr9076775vsw.36.1617376151718; Fri, 02 Apr 2021 08:09:11 -0700 (PDT) MIME-Version: 1.0 References: <20210402123959.5143-1-alobakin@pm.me> In-Reply-To: <20210402123959.5143-1-alobakin@pm.me> From: Sami Tolvanen Date: Fri, 2 Apr 2021 08:09:00 -0700 Message-ID: Subject: Re: [PATCH] kbuild: merge module sections under CONFIG_LD_DEAD_CODE_DATA_ELIMINATION too To: Alexander Lobakin Cc: Kees Cook , Jessica Yu , Miroslav Benes , Emil Velikov , Sean Christopherson , Masahiro Yamada , linux-hardening@vger.kernel.org, linux-kbuild , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 2, 2021 at 5:40 AM Alexander Lobakin wrote: > > When building with CONFIG_LD_DEAD_CODE_DATA_ELIMINATION, > -fdata-sections and -ffunction-sections are being enabled by the > top-level Makefile, and module section merging is also needed. > Expand the ifdef (and the comment block) to cover that case too. > > Fixes: 6a3193cdd5e5 ("kbuild: lto: Merge module sections if and only if CONFIG_LTO_CLANG is enabled") Wouldn't this trigger the ld.bfd bug described in the commit message when LD_DEAD_CODE_DATA_ELIMINATION is enabled? LTO_CLANG always uses LLD, so it won't have this issue. Sami