Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp287151pxf; Tue, 6 Apr 2021 22:35:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL3MD5uapr9u3GT7gZr7eFQcofI1FmQtTtOqgWAFD7WK6yCucB8ouBkcbon06TBAZ9fp5Z X-Received: by 2002:a05:6e02:b2c:: with SMTP id e12mr1439447ilu.161.1617773740439; Tue, 06 Apr 2021 22:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617773740; cv=none; d=google.com; s=arc-20160816; b=i5qmrwOOv47tg4G5mKaQ/PTsaD5isPJavLVtoZhWtKMViIGOKllQ/ZxZsxdu1o1v3M Khtd4W1cHQa1swN24cZwIpPKLLTU8qg9U7iXvzleKsr2OWBGlpHRrd3vKNz4xovIgZEc umfOK9YSCMWQC/A9/YHH1BIpHLh8h+mPxX6Um/H7oPHT20sWEUMp6TtqVQfMSzd7Ivo9 4u2WaQCilgtJW/bQtvAn+dXpI/NUZYxdeREg9++Nh7bPXI6DfkzcBhGOuyTcYjI//5iO WytDZsxK7MUWAExRqaq7SWRzUNGHu+o1UuexJ6Lv/nJksrj5Z9d70huU3AkgPk5kKbHE RbZg== 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=oJpZdJdRCbGDRnUwga5oT056lLMZteop8NZbFOdEXdE=; b=0QJ3nOi58Gr7nmErSZk2kvjFuXlUGIpKUSCoIGeZQ3Alz6F05SoMGUm+UhVXVD4fmV darhgUP+dsZRqU145N3REts6Fk1ZJ4E8tvOGdRaLwpAFAU93bLQd5XIuzjIwMjWECZm1 JlGoILUwHykateaAl7L4sq2Lk/Wp7DGRwZ6JEAqllVJh8h9/1bOVTqbTcD/pvZx5MK5D U7ZihaX773wtTI3KINWg+MVRh/Sb7BuEDzJJ9UqqyNFnY01Ak2T2VDIJlLIq19HaMkHl pgF05QnHsNKuG49XDXXteWL/KK3VWJE1n1RlAJf0soUtJbFhAEnPAePQvvczWxTzsmzO 4sjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=LhDCuK2T; 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 p6si5268144ilo.32.2021.04.06.22.35.28; Tue, 06 Apr 2021 22:35:40 -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=@pm.me header.s=protonmail header.b=LhDCuK2T; 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 S1345092AbhDFOmm (ORCPT + 99 others); Tue, 6 Apr 2021 10:42:42 -0400 Received: from mail1.protonmail.ch ([185.70.40.18]:56216 "EHLO mail1.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345264AbhDFOmj (ORCPT ); Tue, 6 Apr 2021 10:42:39 -0400 Date: Tue, 06 Apr 2021 14:42:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1617720149; bh=oJpZdJdRCbGDRnUwga5oT056lLMZteop8NZbFOdEXdE=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=LhDCuK2TaPMHBvK0ZdULyzsJMyTCHi6w/6LZRO1wZgu15z7RYuMLl18o6dWHe8kVq WL6SrEz9no1GSQLwOiQYZlPnkRLvZ94+jpco1XCDmxbtAzTeSfd6+PL1Nsi1NXSKI6 /Pehtfs++C1q51sOQAQ+0thQQFVhuebHhH6vbk+GidCHeendFIazfyP3o4cHuh5lyK lbaI2eumHvcKUHcnxRdGS4hqhOAyGOWf+X7iyyPnBZsdcc81NlgOQkDVm/bqWs8jpI riU79Fnm8z/LaYMXtnyhOwzQTqJZFnuxSQh/NK6d8DvUD3HOJ9NU5x/JL/zNbVgymZ Gv3ftphgHz+Uw== To: Sami Tolvanen From: Alexander Lobakin Cc: Kees Cook , Jessica Yu , Miroslav Benes , Emil Velikov , Sean Christopherson , Masahiro Yamada , "linux-hardening@vger.kernel.org" , linux-kbuild , LKML Reply-To: Alexander Lobakin Subject: Re: [PATCH] kbuild: merge module sections under CONFIG_LD_DEAD_CODE_DATA_ELIMINATION too Message-ID: In-Reply-To: References: <20210402123959.5143-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 On Friday, 2 April 2021, 18:09, Sami Tolvanen wrote: > On Fri, Apr 2, 2021 at 5:40 AM Alexander Lobakin alobakin@pm.me 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. LD_DEAD_CODE_DATA_ELIMINATION is marked =E2=80=9CEXPERIMENTAL=E2=80=9C in the config prompt, and arches have to opt-in HAS_LD_DEAD_CODE_DATA_ELIMINATION to give an access to it (only a few does). This should be relatively safe. > Sami Thanks, Al