Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp847266pxf; Thu, 25 Mar 2021 15:42:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9RlqKxRHx55ggp9tmv80MXLkrGY9mKG2P1NFquGzxa0RG+h9v0EC1R/fMu64Llsd4P44n X-Received: by 2002:a17:906:1a44:: with SMTP id j4mr12207916ejf.401.1616712166985; Thu, 25 Mar 2021 15:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616712166; cv=none; d=google.com; s=arc-20160816; b=GRe8eFqZu6QMbx7AL4BKz07ENuvoFrhm/t9kPrryaTGMwr0bsYXaVGa0RK1lkl1qnz TKi52LLi2C3HCRxbmBocmDdrxTr9u3QMJ77Idt5E6T0KktPX+a6LMsXt1Hsa0ho4GEdn I/k9POQF+rj+OA74/ZR2cge7Egplchw1j26V/5R8JXezelKHW6Yd3NMKJcE0MIu3+pKi rgDheMz5YDBvr1J9mucYzbl9AJG0wIY9d0WQuKmT0dIS9npFydE4TLmo/537IPBlIEts I4oKKswAcL+IN2ObifxZmoLtwjyyCK6mcSccg9jToiXsPPn0YjR9xGjnX1KNLFfKmcwm nlTw== 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:date:subject:cc:to:from :dkim-signature; bh=J3+RGtzF40QhDfagU+nYk1uClPO3XR1kP4GfFGGm5h0=; b=A/I33Ii1jhj1ovN/RlBS66wpJ79mPtm3gkdfn/BXIP8dvmG1ksUEsPEKXdJU1y6Cp4 DjukO/DitGiNb5qy8/o4i6dw43Wg+vkFII+cROX+V/JxUYdS73pvsm4t5Rwp1C2zA1oh sH55lt8gRQNuRfOyX0PoZWv3Z947QgvnmxBDgEAnGGHRNH57MhtVl3CEE65pwrllCyDL XHGrddgz8IzPftKCRw5tVRQthACIJFXPOTS6ubMmlTXfUVcF7hK3gy4KF038e8KaY0MX I0sfvUHlg3BeyqAigDHJnoKcSftuTaWtp0zreUagXaiETwFt3/FMOyU2edRjHK8pJl5E 5MZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dRF7V82C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si5437697edy.227.2021.03.25.15.42.24; Thu, 25 Mar 2021 15:42:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dRF7V82C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231322AbhCYWi6 (ORCPT + 99 others); Thu, 25 Mar 2021 18:38:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:49170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231277AbhCYWi1 (ORCPT ); Thu, 25 Mar 2021 18:38:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ED2CA61A38; Thu, 25 Mar 2021 22:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616711907; bh=73VsQ5V66Z2i7UXDiahsIQeBPPsxjN8due9MczLEMgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dRF7V82Cjx0UE7OpHE9CYFwTxnGorcqrArlaxwiXw09aA7xjV84Mh7qKkbMlVA55G zVeSjr8BjzfGh0UVaOFX+nLpdD91EeWEW2+85FV4GjRn6YM0ckCbk/4Hpq7iQXS83r w0zNmMm3rW4SDn5QMH6X3jJRJbK8vmTBISf4iKs4g1HlxdM9Pg+NZziOuinvQ5fxb6 gIFK1bSKKv2xGuzWzoj5OrcisVPSbd7BDVEfw6C2sIBnYbOFIwucs1Zg+pHwQpFpgA /2c5XgMc/8Y1Y3ZQubBkMKMBs4BZAkaXq56HAkSRmxbJzjh6o7cfeimQ4MUs3B2h+1 34GnFcvzYGQ1A== From: Nathan Chancellor To: Palmer Dabbelt , Paul Walmsley , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , stable@vger.kernel.org Subject: [PATCH 1/3] scripts/recordmcount.pl: Fix RISC-V regex for clang Date: Thu, 25 Mar 2021 15:38:05 -0700 Message-Id: <20210325223807.2423265-2-nathan@kernel.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210325223807.2423265-1-nathan@kernel.org> References: <20210325223807.2423265-1-nathan@kernel.org> MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang can generate R_RISCV_CALL_PLT relocations to _mcount: $ llvm-objdump -dr build/riscv/init/main.o | rg mcount 000000000000000e: R_RISCV_CALL_PLT _mcount 000000000000004e: R_RISCV_CALL_PLT _mcount After this, the __start_mcount_loc section is properly generated and function tracing still works. Cc: stable@vger.kernel.org Link: https://github.com/ClangBuiltLinux/linux/issues/1331 Signed-off-by: Nathan Chancellor --- scripts/recordmcount.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 867860ea57da..a36df04cfa09 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -392,7 +392,7 @@ if ($arch eq "x86_64") { $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$"; } elsif ($arch eq "riscv") { $function_regex = "^([0-9a-fA-F]+)\\s+<([^.0-9][0-9a-zA-Z_\\.]+)>:"; - $mcount_regex = "^\\s*([0-9a-fA-F]+):\\sR_RISCV_CALL\\s_mcount\$"; + $mcount_regex = "^\\s*([0-9a-fA-F]+):\\sR_RISCV_CALL(_PLT)?\\s_mcount\$"; $type = ".quad"; $alignment = 2; } elsif ($arch eq "nds32") { -- 2.31.0