Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp2107111pxb; Sat, 19 Feb 2022 02:24:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9jHeiWHNsfqUrCG978buM/39QtQbXXEkziLw9CZ7BCbrOyDtY7hvfgOBiAJkdYN1bT9+3 X-Received: by 2002:a50:da4b:0:b0:40f:28f0:c2c0 with SMTP id a11-20020a50da4b000000b0040f28f0c2c0mr12148087edk.374.1645266272976; Sat, 19 Feb 2022 02:24:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645266272; cv=none; d=google.com; s=arc-20160816; b=cdf0rh+4IAsuB4LUqGf31Hh23YfMZgXiPQiSMna9cC/WM5Iho7rjM5/x+ZM4U4yvo2 YPS1J1QH9+M5EElvjLVLNe9+pq/83krZ7/CHxQ2F5OrbXo5wB4omrhGs0AtrJl3xd2kc 53roiS+nz4vZPIIru01kEAW/JrjmHc7JaI8474lxP/g1JkChorrWDtMpwjS1K+oPXTke CEI3udH/8j34frHqKhy2cdx1GKRPcv+VuAL5fltj5GWjLwKNJ0kq2oTO6KkBM6azm/9D +LFzU97O6vbkRqANRpEzpJzaSjkod8wi5XAcUcpkyq+ijLrP6Mz6nqOUBihSo3+hcH8D Q4qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id:dkim-signature; bh=dtE4TxbRN5b4MUyKtNVPCJTQt/NBj65e8QNm1bw+r8Q=; b=pRROZBKuHp/q/yxYUYAWwpX6J/IOQjgnDAQEnEb60v1+a8z4ijJjzGS6Q6eCSiVb4R /pzOUgMdqRQQsdhyTusy5ZksWrkSz1aQD1M27tOJvWwXH90dBwhMvr+U8tN4+3AsewBa 3zv2cdlgpEsuPwwscCU8FBYLqnmdPIhabnb7yN4snuhmO6E3ycdFX/DeidssHRLAeHW6 5fsdot0wLCXt82RFgKfTZ8cABskTqjehtFe8lBRTHrCqHuH2Ko6FC4cKv0u3rBx3xeuf 2QpkWw4zz7lEvMiLseHy9Ramt+YmzblH2GylvyvWhFOq08UzJ/MDFlYwDwQkxTb5KTRl 3jjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=ZM2cMHew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10si6024530ejj.216.2022.02.19.02.24.08; Sat, 19 Feb 2022 02:24:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=ZM2cMHew; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238374AbiBRRPu (ORCPT + 99 others); Fri, 18 Feb 2022 12:15:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232732AbiBRRPP (ORCPT ); Fri, 18 Feb 2022 12:15:15 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066A54C790 for ; Fri, 18 Feb 2022 09:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=dtE4TxbRN5b4MUyKtNVPCJTQt/NBj65e8QNm1bw+r8Q=; b=ZM2cMHewk1Uybk+SynhmAmbTEQ cNMEnstfan9uyFTTzHsG7J3RN5j1W991VrozduuFjItjXJp08anGaG5KazTxZtlTo2Bj0KO3WcX2U 8OEn1VABkjPgjh5/OPJbco2/Bo57mnBhOlZFIgQ5Yo5MrvvH/NYuQbJunzQGtBG4SAU0ymvtZfhxN JdL1T46Qd5+guSmisVuVHbQJ9bWCPVeMBu1SXLD9WjGdKZvPfyxjpo3xlpbN5q22+R1Lex+Bhdn/R s10GcAvnODqjndmSjWtpbmXrf8INpi+YlPDQr5rlVikV/f+jQ0C0L3LGBz52fKcH/ZJI4TpOhigOv qsciP7AA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nL6qA-00AsBh-Kd; Fri, 18 Feb 2022 17:14:45 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D2B9830214E; Fri, 18 Feb 2022 18:14:39 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 5C0472B058EB8; Fri, 18 Feb 2022 18:14:39 +0100 (CET) Message-ID: <20220218171409.814392411@infradead.org> User-Agent: quilt/0.66 Date: Fri, 18 Feb 2022 17:49:23 +0100 From: Peter Zijlstra To: x86@kernel.org, joao@overdrivepizza.com, hjl.tools@gmail.com, jpoimboe@redhat.com, andrew.cooper3@citrix.com Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, ndesaulniers@google.com, keescook@chromium.org, samitolvanen@google.com, mark.rutland@arm.com, alyssa.milburn@intel.com Subject: [PATCH 21/29] objtool: Rename --duplicate to --lto References: <20220218164902.008644515@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to prepare for LTO like objtool runs for modules, rename the duplicate argument to lto. Signed-off-by: Peter Zijlstra (Intel) --- scripts/link-vmlinux.sh | 2 +- tools/objtool/builtin-check.c | 4 ++-- tools/objtool/check.c | 7 ++++++- tools/objtool/include/objtool/builtin.h | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -115,7 +115,7 @@ objtool_link() objtoolcmd="orc generate" fi - objtoolopt="${objtoolopt} --duplicate" + objtoolopt="${objtoolopt} --lto" if is_enabled CONFIG_FTRACE_MCOUNT_USE_OBJTOOL; then objtoolopt="${objtoolopt} --mcount" --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -20,7 +20,7 @@ #include bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, - validate_dup, vmlinux, mcount, noinstr, backup, sls, dryrun; + lto, vmlinux, mcount, noinstr, backup, sls, dryrun; static const char * const check_usage[] = { "objtool check [] file.o", @@ -40,7 +40,7 @@ const struct option check_options[] = { OPT_BOOLEAN('b', "backtrace", &backtrace, "unwind on error"), OPT_BOOLEAN('a', "uaccess", &uaccess, "enable uaccess checking"), OPT_BOOLEAN('s', "stats", &stats, "print statistics"), - OPT_BOOLEAN('d', "duplicate", &validate_dup, "duplicate validation for vmlinux.o"), + OPT_BOOLEAN(0, "lto", <o, "whole-archive like runs"), OPT_BOOLEAN('n', "noinstr", &noinstr, "noinstr validation for vmlinux.o"), OPT_BOOLEAN('l', "vmlinux", &vmlinux, "vmlinux.o validation"), OPT_BOOLEAN('M', "mcount", &mcount, "generate __mcount_loc"), --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3501,6 +3501,11 @@ int check(struct objtool_file *file) { int ret, warnings = 0; + if (lto && !(vmlinux || module)) { + fprintf(stderr, "--lto requires: --vmlinux or --module\n"); + return 1; + } + arch_initial_func_cfi_state(&initial_func_cfi); init_cfi_state(&init_cfi); init_cfi_state(&func_cfi); @@ -3521,7 +3526,7 @@ int check(struct objtool_file *file) if (list_empty(&file->insn_list)) goto out; - if (vmlinux && !validate_dup) { + if (vmlinux && !lto) { ret = validate_vmlinux_functions(file); if (ret < 0) goto out; --- a/tools/objtool/include/objtool/builtin.h +++ b/tools/objtool/include/objtool/builtin.h @@ -9,7 +9,7 @@ extern const struct option check_options[]; extern bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, - validate_dup, vmlinux, mcount, noinstr, backup, sls, dryrun; + lto, vmlinux, mcount, noinstr, backup, sls, dryrun; extern int cmd_parse_options(int argc, const char **argv, const char * const usage[]);