Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp254793pxj; Thu, 20 May 2021 08:41:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlMA+A9kHQgyxmKfptK3ju3z0AjUAiyGxLoterG41FR1lZQaWLydTtNI2Ok2rvvMYUYqSm X-Received: by 2002:a17:906:c9cf:: with SMTP id hk15mr5218681ejb.445.1621525264106; Thu, 20 May 2021 08:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621525264; cv=none; d=google.com; s=arc-20160816; b=UU9Xo3v14vyCkWr/hYws0XKXfzYEknxcmAkMfAOt4w05LU8QGVLQTZveZTjouw6SeZ O3wzx2F6alapoO4WfAKcc9qa9DcOVPw0WZ803Jzmex2HuWwMJL3swSoZDPWNUvbRZGKn hsXL3JKE0rWtdcETb4gUKR4He/dv2f9H1ODytlmmllXh0EC95QgnHGXncAN6EQcr0L1p ORSyMgH0tHoT1DZ/6ga5TViHkXXsEkPzoYIOivxk3sGy7d1Yna4lJc+eZh8lf37Xuyvc aw9WUpiQikYUGt0SvOVV71TUS/OpikDuVv3WOwYK9Xyb7WLS5nDd7ZcnXgMgZQt4pTuW v1tg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BLIJUT6/SIA22fzxvCOoHTZ80FPxPC8vxYV5lXVlQek=; b=mMml7jsIKEE7SSNaar1Ko2a6krEk9OaTyTs55ngp9hSTKATH3kS/27zP4BK8kqh1hR klUNebXdpq+ydvkDd5bnyQJbT6Yga/CYfVoGG5Rj/JYymZh67trdBNL3v9wXUe6Xh/HQ pYmOHjNWwzM7UPQZpgl3mC5XER7GwNwbzuwUQOXtqEMAQ8vYFVHrTcD+Yj2H07TuFZzO eURPQ/IHZh5ADRVs5/nBXkiT2iCRmSPV/wFM0axzaftNhze6ysiFw9mIKl0YxvMRxZrk CMuMjgNJaCvujOHe3+3TF58B3/fO1hyPNuhd2W0LvB/AAQ+gfqBaNpGW7eyOSUhEt0+i VM1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GBQqDJY8; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si2877555edy.339.2021.05.20.08.40.40; Thu, 20 May 2021 08:41:04 -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=@linuxfoundation.org header.s=korg header.b=GBQqDJY8; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232967AbhETJgq (ORCPT + 99 others); Thu, 20 May 2021 05:36:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:33284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232894AbhETJe0 (ORCPT ); Thu, 20 May 2021 05:34:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E53DC613AD; Thu, 20 May 2021 09:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621502951; bh=VDysD30fRwug+xHWx7FdQENfFyUXpotZ39qTSFeyguk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GBQqDJY8vBcRO3xfD7gG9mYKBen8VzVohq5AFkLtIFopkg+pBjc9IUG7CdS5vxQMf zhir8w9NRvTx9/Ma3oWZ6X4wmlIHvcjSZdWjGZ76StQuFwHagvJP4ubGToaiSkpDmf bf95szPyievUSxLFuSLph6lsxST4HvWDkL3MoC5k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Fangrui Song , Palmer Dabbelt , Sasha Levin Subject: [PATCH 5.4 19/37] scripts/recordmcount.pl: Fix RISC-V regex for clang Date: Thu, 20 May 2021 11:22:40 +0200 Message-Id: <20210520092052.912394336@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092052.265851579@linuxfoundation.org> References: <20210520092052.265851579@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 2f095504f4b9cf75856d6a9cf90299cf75aa46c5 ] 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. Link: https://github.com/ClangBuiltLinux/linux/issues/1331 Signed-off-by: Nathan Chancellor Reviewed-by: Fangrui Song Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin --- scripts/recordmcount.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 0bafed857e17..857d5b70b1a9 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -395,7 +395,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.30.2