From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F19F1C43461 for ; Thu, 10 Sep 2020 19:46:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A763B21556 for ; Thu, 10 Sep 2020 19:46:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="eC6xHFZe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727035AbgIJTqd (ORCPT ); Thu, 10 Sep 2020 15:46:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726966AbgIJTpr (ORCPT ); Thu, 10 Sep 2020 15:45:47 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 250CCC0613ED for ; Thu, 10 Sep 2020 12:45:47 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id v196so5435292pfc.1 for ; Thu, 10 Sep 2020 12:45:47 -0700 (PDT) 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=kT3st5L2W/yGrskNA7hV4WTKcp+VzTZ5Pgaqe30vqT8=; b=eC6xHFZebGzDOu2iJFlC4sYhGBsPBPtk9a7oklICzLNlEMzSAdGnasLCc1rhvVduzw WWGkAB927UqclP1++HPY0zndFIqCAsSEoCB33GsJW1zgx9zdnqi9fNwkG+wGtFEr+T3z bUYjH1Oc2jBMRnj0f0FQ3tH0tHQIOzzYF+914= 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=kT3st5L2W/yGrskNA7hV4WTKcp+VzTZ5Pgaqe30vqT8=; b=ZG4tp+t71CqLf458mTUuC2iYKl38mD407TkRDBbMwpg1rP/cLxZnel3nZJD24CSXWD ocsUx2oE+pcRJ0RtAseW9f2Fix6WanLSAMRxB1aOOt9AWAHNuml5vpQoaGQrClISumWB BHJLVuIVd7gWwMSJ/Rh3i2COLdLdMN6A8TPZqmMySqqLQqYsmknBoWla9Uxt7zg3l8vg YPT9BcCjv5ve3EE739kAMGORrrVCTPF/pyPtLlh17rxKzJWLcRnH+Rp+O+F7Y1vRV05K 3dzDVJ8H+uo0oLG1Jhroo/+WaTSkwEE/sREe49Zel7J1i+C06QmRs7Qa2cVswmFR5a9r ET2Q== X-Gm-Message-State: AOAM530cO+IW6pGMkULtT/XdZ1ofQ3X/hSdFWFpuD6OyBfMqCTe5OVcj ExQEhoL6GgCWdHzpCCKsQ/apXw== X-Google-Smtp-Source: ABdhPJwWpKs77i2Pw4YhFhAT5cZe6s0qx17kIVE+as0BWVJNc55TKLnEBagdP5cQWEjWPugWxrbACw== X-Received: by 2002:aa7:858e:: with SMTP id w14mr2753410pfn.95.1599767146631; Thu, 10 Sep 2020 12:45:46 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l79sm2905776pfd.210.2020.09.10.12.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 12:45:45 -0700 (PDT) Date: Thu, 10 Sep 2020 12:45:44 -0700 From: Kees Cook To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-ia64@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Paul Mackerras , linux-riscv@lists.infradead.org, Will Deacon , Ard Biesheuvel , Anton Ivanov , linux-arch@vger.kernel.org, Mauro Carvalho Chehab , Richard Weinberger , Russell King , Ingo Molnar , Geert Uytterhoeven , Benjamin Herrenschmidt , Fenghua Yu , Albert Ou , Arnd Bergmann , Jeff Dike , Jessica Yu , linux-um@lists.infradead.org, linux-m68k@lists.linux-m68k.org, Tony Luck , Paul Walmsley , linux-arm-kernel@lists.infradead.org, Michal Marek , linux-kernel@vger.kernel.org, Palmer Dabbelt , Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] kbuild: preprocess module linker script Message-ID: <202009101245.493610D05@keescook> References: <20200904133122.133071-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904133122.133071-1-masahiroy@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 04, 2020 at 10:31:21PM +0900, Masahiro Yamada wrote: > There was a request to preprocess the module linker script like we do > for the vmlinux one (https://lkml.org/lkml/2020/8/21/512). > > The difference between vmlinux.lds and module.lds is that the latter > is needed for external module builds, thus must be cleaned up by > 'make mrproper' instead of 'make clean' (also, it must be created by > 'make modules_prepare'). > > You cannot put it in arch/*/kernel/ because 'make clean' descends into > it. I moved arch/*/kernel/module.lds to arch/*/include/asm/module.lds.h, > which is included from scripts/module.lds.S. > > scripts/module.lds is fine because 'make clean' keeps all the build > artifacts under scripts/. > > You can add arch-specific sections in . > > Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook -- Kees Cook