Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4608469ioa; Wed, 27 Apr 2022 07:24:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLrW6j7HMTN1J0/9F7mmRfct03YStrhjQJAr+eqCR7G8WgcZkJ2wkzi3RnlplyJrZXn+S1 X-Received: by 2002:a17:903:1051:b0:15c:f02f:cd0e with SMTP id f17-20020a170903105100b0015cf02fcd0emr21371497plc.81.1651069477988; Wed, 27 Apr 2022 07:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651069477; cv=none; d=google.com; s=arc-20160816; b=v53WXrZFmK8KzUvIipF0oq9ga2j2Htv5uqo6FGpYY3aEhgozIHdWrh7GGRCCIVGPwy JglQSOggCKCA6I4qDU8YpDUb21zsgLKuRwZ+GCLlTJwSzN7/tM6RiEzRL2/1k6mPgQuf Wew8XRgpmatBXXJnCtFwRj8xcF+8lc9nLUG+xlEQwatrQB809Sek6EIeahlRp+t9PFK+ r/Ar0Cm9uX+niRsa/Qb84xjgI4ROfas/wDfau5Q7PuJL6QDzN7DIdrjL46mKPskFGXlu yRZIvGoxHUxHGoVwIszkoY/XtgmESPmeM88bGKeipGkWUhmlvWmyhUlRee45315fg1sF Io3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=duE9m1snkldHLa4IwoEa6DFD/WhWgWY0n1MJ2z/M8D0=; b=KZPCqQC/Zqhg9Ewh+BmwXGak3xm/w7wNO0NmbAYFfqefqcocRH2Ue5m3dTY2qamiku glPKYdUVhPGeSiE8PlJdMfYWiA1poZZ/jphO++tc3GeBr2DViIp6i2xE4C1EAtrQn7SZ BvNxbnbQ2LM0wIZJTxmTvCmVu1+YtEZWk68T8fp2nTuuqsQKUpTG/VXPgHNK1zK5/nyw hS/6eKuu3skIy5H3S9w62J/cmxORm9Q+sE6nB0H70/S9AqKFkq1rSGGmIUOMlEp0BUI0 KLDjI8JR3qgh9saAiDHsCf4BOsmFg4523xDWF9FJ+35cOumpNsLIXMAHDbTcQAvh+H1l 9Hig== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e12-20020a65688c000000b0039919e929e5si1508086pgt.813.2022.04.27.07.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 07:24:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BBBEA13DD1; Wed, 27 Apr 2022 06:54:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236729AbiD0N5e (ORCPT + 99 others); Wed, 27 Apr 2022 09:57:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236645AbiD0N5b (ORCPT ); Wed, 27 Apr 2022 09:57:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E834248B for ; Wed, 27 Apr 2022 06:54:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0A526B82778 for ; Wed, 27 Apr 2022 13:54:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A50CC385A9; Wed, 27 Apr 2022 13:54:16 +0000 (UTC) Date: Wed, 27 Apr 2022 09:54:15 -0400 From: Steven Rostedt To: "Naveen N. Rao" Cc: Michael Ellerman , Nathan Chancellor , Nick Desaulniers , , , llvm@lists.linux.dev Subject: Re: [PATCH 2/2] recordmcount: Handle sections with no non-weak symbols Message-ID: <20220427095415.594e5120@gandalf.local.home> In-Reply-To: <1b9566f0e7185fb8fd8ef2535add7a081501ccc8.1651047542.git.naveen.n.rao@linux.vnet.ibm.com> References: <1b9566f0e7185fb8fd8ef2535add7a081501ccc8.1651047542.git.naveen.n.rao@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 On Wed, 27 Apr 2022 15:01:22 +0530 "Naveen N. Rao" wrote: > If one or both of these weak functions are overridden in future, in the > final vmlinux mcount table, references to these will change over to the > non-weak variant which has its own mcount location entry. As such, there > will now be two entries for these functions, both pointing to the same > non-weak location. But is that really true in all cases? x86 uses fentry these days, and other archs do things differently too. But the original mcount (-pg) call happened *after* the frame setup. That means the offset of the mcount call would be at different offsets wrt the start of the function. If you have one of these architectures that still use mcount, and the weak function doesn't have the same size frame setup as the overriding function, then the addresses will not be the same. -- Steve > We don't need the non-weak locations since they will > never be executed. Ftrace skips the duplicate entries due to a previous > commit.