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 02CBFC43461 for ; Thu, 10 Sep 2020 19:46:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A764B21556 for ; Thu, 10 Sep 2020 19:46:26 +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 S1726662AbgIJTqW (ORCPT ); Thu, 10 Sep 2020 15:46:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726932AbgIJTpr (ORCPT ); Thu, 10 Sep 2020 15:45:47 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F81BC061757 for ; Thu, 10 Sep 2020 12:45:47 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id g29so4857597pgl.2 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=QAFl9r3DQiPkswxUTGkL7Trqk9L8h65h66zMWdwwnSfcFznT6EhgwrTuZ4Yb74uOJT +T7yRZbD/VNt5Mz/6TDyNEn1VY7eruImJEAcq/fSjlOV5o/WRRx64t/Zhc+lblLo5bv9 uX71etnU6h5Zpo4DXrX2KZW3fq+TNOMSGzc2URTBz+WFAj/yodXB8Xp1+trUDeh25Psw yuAmwRSFLJKgxrMOIeuUBmvleJ9jcOo0ABkBXtUWpreMI4MF5wAQwAVmZBV2Sdc8sRMc 2PnsqJ7jlH1cPKXKKzCY8DSLnIFcCkXoOjylJ7rH+Pmr/AxPzj4dnCdUZFVXWIEK+LHB qE3w== X-Gm-Message-State: AOAM531KE28Wb2AGMBjhH6YKaOHWF8Mj/FzCKYVQ7jvEJ6MH10NiRi+n NLMOZj+VW/pdcI/lM3nfONg6xg== 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-arch-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arch@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