Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp893546rdb; Fri, 20 Oct 2023 02:32:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJJuiub39MChq41UlF+SVsukRK4UGqctnkA9iHJyuyT0HOllDqvYfERjnX4JWtra4t1Ubr X-Received: by 2002:a05:6a00:150d:b0:6bc:ce7a:6f39 with SMTP id q13-20020a056a00150d00b006bcce7a6f39mr1162391pfu.32.1697794323972; Fri, 20 Oct 2023 02:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697794323; cv=none; d=google.com; s=arc-20160816; b=XWgNDm90c3/ALwmY+dqglR46hHLh3ULbomob08S6IWalpV+YrGvzz0UHCjFqgwc55R UqcnnC3s6Lnb+5/KGLZ3A10Gkw3PzHOQX7cTWRVkFjKhZeJvPlTUJuf83wZ+OjZsh4J9 EU5ge1wEd8RU9U4Mw+Sq9Ov+yS0b01wQnEDPvi1FQ+nDV6ue/ZKqMRmKJ50XKH0g2dfV PEmH9hLSMbXXmI2oxY5HAFneizAylREB0dP7e13R/y/5uN68sEYTaxxpe0XAt3v/vOYq Of6tKFraTRYUhjUdcVI9SWYaWTmGiHGZV86uVT9Y9Gd3gOqn4sxbDczSsgLXt/FAtBWV X02g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nkRbIeka6D9hktLXrz9eFYF7RLBS9b1Mb7EA0LnaqAs=; fh=H5wOFSLRnBinLRKxza/pI3yiQf7h+Za3jsV1XQhnSeA=; b=L/9xKFjuf1FnoSufwATVQIJiGQNk50SlTlhaWB1r+wynhmp+j6q5vHJF8J8Qb/EN4P XP3Ih6mfh9iBlJN6GJY0bZ48oLpsOhN6uPkXKeOHYMweULzLI6uU76ACF4nVB0mFPK7R kpFHaW8/JsiwCUpKxLTF8f4jD3oF8tO+zrbj8RQNus/+HLfNOfVIcXGtmk3Bn8aiS8TT wNDSL4Pj2ZSxE4BZZ5xXVCEIk/JNM8dKsUuPGilG+DDwdVTN5gnEDUdgHnctZ9+bkhP2 3YCWm2RbaVP+U6e+B7eu83cpmyYyU4dzoYhjixCMNnTftDp1Sz8m+Bd9pZj6vpkOwLC/ EdAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jzRRY2jA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g16-20020aa79dd0000000b0068fad24a32csi1494074pfq.27.2023.10.20.02.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jzRRY2jA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1D77C8068858; Fri, 20 Oct 2023 02:30:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376662AbjJTJat (ORCPT + 99 others); Fri, 20 Oct 2023 05:30:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376627AbjJTJas (ORCPT ); Fri, 20 Oct 2023 05:30:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B737D49 for ; Fri, 20 Oct 2023 02:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nkRbIeka6D9hktLXrz9eFYF7RLBS9b1Mb7EA0LnaqAs=; b=jzRRY2jAbC2JrZLmV54U9W9qOw bkMbHIH76swqn1SPX8cjp9ieDsdG2VK6K5DGZuYnZjvJwoX6gM9emZhNGBDcOslLMFqNIgQhHL4eW zHxsLLoqRn3jd7SjLKt34XEe1QTuZD/305FtFLOOsM64rr87VAvsHuyil1OzbJlufo/YZZ4gHmrfD 9EffeYn9BIPaN7eGWsSM9u7g8RTy9dzl0Ke04YI1jK22TwqkIxW22vaHDPweLfbIAlw6ow08Z7Xxy 1WRFjclpnnili5RaGOobS1A7n9X7VRROHtbRfJ7eUiEWiUeamao+//QCRCjzWntSuk4+LUL+QZgsi RjUAbdGQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qtlpw-00CKzN-D5; Fri, 20 Oct 2023 09:30:32 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 16BAB300392; Fri, 20 Oct 2023 11:30:32 +0200 (CEST) Date: Fri, 20 Oct 2023 11:30:31 +0200 From: Peter Zijlstra To: Tiezhu Yang Cc: Josh Poimboeuf , Huacai Chen , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: Re: [PATCH v3 5/8] objtool: Check local label about sibling call Message-ID: <20231020093031.GB31411@noisy.programming.kicks-ass.net> References: <1697768821-22931-1-git-send-email-yangtiezhu@loongson.cn> <1697768821-22931-6-git-send-email-yangtiezhu@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1697768821-22931-6-git-send-email-yangtiezhu@loongson.cn> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 20 Oct 2023 02:30:53 -0700 (PDT) On Fri, Oct 20, 2023 at 10:26:58AM +0800, Tiezhu Yang wrote: > + if (reloc && reloc->sym->type == STT_NOTYPE && > + strncmp(reloc->sym->name, ".L", 2) == 0) > + if (reloc->sym->type == STT_NOTYPE && > + strncmp(reloc->sym->name, ".L", 2) == 0) { Would not something like the below be better? diff --git a/tools/objtool/check.c b/tools/objtool/check.c index e308d1ba664e..a57d293c834d 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2506,6 +2506,9 @@ static int classify_symbols(struct objtool_file *file) struct symbol *func; for_each_sym(file, func) { + if (func->type == STT_NOTYPE && strstarts(func->name, ".L")) + func->local_label = true; + if (func->bind != STB_GLOBAL) continue; diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/objtool/elf.h index 9f71e988eca4..2b8a69de4db8 100644 --- a/tools/objtool/include/objtool/elf.h +++ b/tools/objtool/include/objtool/elf.h @@ -67,6 +67,7 @@ struct symbol { u8 profiling_func : 1; u8 warned : 1; u8 embedded_insn : 1; + u8 local_label : 1; struct list_head pv_target; struct reloc *relocs; };