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=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 373B3C43463 for ; Fri, 18 Sep 2020 21:31:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9F52222BB for ; Fri, 18 Sep 2020 21:31:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="seALZBew"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="W+/RKJ9p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9F52222BB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bbOwlRDm6E23bON0Qe01VkxBAvxzMnAmvFOn1SCBxuE=; b=seALZBewjGM3R6349Fq30SibF lIvUFu+j3uQ70E6QRLbsS+FyGAdzGIo4lD/NDLL21ECATd+wSJQFqofvEt7TDQHcFKIaJt8UFfP/F UnGuRpsiTRKaam0xPIbz3SG7CgDQYuby3hkS9+ttfyH6IwtekT/ORvDHeGw7RBb8Qy2wsP+8M04Ar yzw8TVUgtsT63yUYw2z0n42EQgc6IXBIstsV8KBA1xxP5uF0BpokTj5KDCL1sglmSkvJRcfz6PMEF /zNXxwi15aKZlQN2uChCoeeNysHOMXQx9+lNdZAhjuW56fldN18GHMcPqrFRTW37+yZyPeL2sqGR/ 37wedvX/Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJNww-00070G-B3; Fri, 18 Sep 2020 21:29:46 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJNwt-0006yW-Jh for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2020 21:29:44 +0000 Received: by mail-pl1-x642.google.com with SMTP id u9so3656828plk.4 for ; Fri, 18 Sep 2020 14:29:40 -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=GaeOhHfh8L1DCmfaELuYzcrF6n6HIXLIYRNTzqsV79Y=; b=W+/RKJ9pTVfHlLkwso1szh6HtM1ljwgfll2m1S7UpWBfhGNOhcAgS0vcics0UCB6P6 dN86cdQ1w9MJuw6LvS3fM80dVq9dvH5tMXxpAqqbGZHk658zN870WIKFcsCTayCfDtNQ T7NafpHvlBEzNZ5MQFycOCV7aKSjbwjKdKCPc= 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=GaeOhHfh8L1DCmfaELuYzcrF6n6HIXLIYRNTzqsV79Y=; b=MW7HC/e4LRgBS8Y0DlW4+hAb0TzkWW31BvLvMoGoYKU9Adi+GZIJUlRS/mFb+0mM+w hFD8oy2won8o8bDaosKOKQ8jL4ijH+VjTDQlCGPLhFY31H+jXgd6k1dGraeNzeM3N/vK hfaa6zzK4Wrf0TF8hSWRJ6dgG4UzTKkf9MTFBLzb9G7DgBJucK1pFushgzzR+t8DLRwO s00zly+T8WgEsaOW9+WSc1OHWPAlrZEN8gNJXyfbKWiAY90nVuT0V8hNJpZu+3nS2FL+ AJNSLUJQkoPffo+vA/6y5jMjEdpyUZPqKiQmHUl8OVfbrchT90ueL87wK4Rda0Gexu8n ojjg== X-Gm-Message-State: AOAM532A5p+XgZpW9pZEkkHZUeq8/l+M0tVtHAlwFpjf5Ous9SdFijvC UvzXs+r3yt1i7p3ivIfdZUE6Bg== X-Google-Smtp-Source: ABdhPJyRQsmmFdjwcGkpqBzOOW1CFrolZnNpgZgaeJg1rXVSbKFTb9+lQpAZIZvZVlks1h2iMqNz4w== X-Received: by 2002:a17:90a:ad48:: with SMTP id w8mr14636473pjv.179.1600464578722; Fri, 18 Sep 2020 14:29:38 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l188sm4167409pfl.200.2020.09.18.14.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 14:29:37 -0700 (PDT) Date: Fri, 18 Sep 2020 14:29:37 -0700 From: Kees Cook To: Sami Tolvanen Subject: Re: [PATCH v3 17/30] init: lto: ensure initcall ordering Message-ID: <202009181428.3C45B57DA@keescook> References: <20200918201436.2932360-1-samitolvanen@google.com> <20200918201436.2932360-18-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200918201436.2932360-18-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200918_172943_675261_BE3D46AD X-CRM114-Status: GOOD ( 17.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, x86@kernel.org, "Paul E. McKenney" , kernel-hardening@lists.openwall.com, Peter Zijlstra , Greg Kroah-Hartman , Masahiro Yamada , linux-kbuild@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, Steven Rostedt , clang-built-linux@googlegroups.com, linux-pci@vger.kernel.org, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 18, 2020 at 01:14:23PM -0700, Sami Tolvanen wrote: > With LTO, the compiler doesn't necessarily obey the link order for > initcalls, and initcall variables need globally unique names to avoid > collisions at link time. > > This change exports __KBUILD_MODNAME and adds the initcall_id() macro, > which uses it together with __COUNTER__ and __LINE__ to help ensure > these variables have unique names, and moves each variable to its own > section when LTO is enabled, so the correct order can be specified using > a linker script. > > The generate_initcall_ordering.pl script uses nm to find initcalls from > the object files passed to the linker, and generates a linker script > that specifies the same order for initcalls that we would have without > LTO. With LTO enabled, the script is called in link-vmlinux.sh through > jobserver-exec to limit the number of jobs spawned. > > Signed-off-by: Sami Tolvanen Thanks for the update; using jobserver-exec looks much better for controlling the build resources. :) Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel